Forum Discussion

Marco's avatar
Marco
Contributor II
11 months ago

SetDataCells error: workflow settings do not allow input for Time member

Hi everyone.

I have a problem with setdatacells, and it sends the following error: Scenario 'Forecast 2023M10’s workflow settings do not allow input for Time member ‘2023M9’.

I know this is a bit strange, but I need to modify values from the previous month. For example, now that I’m in November, I want to affect September. In February, it allows me to make these modifications because it’s still possible, but I want to do the same for the following months. The function value gives me as a form and I believe it is necessary to pass it to import, but I have no idea how to do it.

For Each strItem As String In ({"Amount", "Annotation"})
    Dim listTargetDC As New List(Of DataCellEx)
    
    For Each drResult As DataRow In dtResult.Rows
        Dim dcpkTarget As DataCellPk = drResult("DataCellPk")

        If strItem.Equals("Annotation") Then 
            dcpkTarget.ViewId = BRApi.Finance.View.GetIdFromName(si, "Annotation")
        End If
        
        Dim dcTarget As New DataCell(dcpkTarget, drResult("Amount"), DataCellStatus.CreateDataCellStatus(False, False))
        Dim dcexTarget As New DataCellEx(
            dcTarget, drResult("Annotation"), 
            DimConstants.Local, 
            BRApi.Finance.Account.GetAccountType(si, dcTarget.DataCellPk.AccountId).Id
        )
        listTargetDC.Add(dcexTarget)
    Next
    
    Try
        BRApi.Finance.Data.SetDataCells(dbConnFW, dbConnApp, listTargetDC)
    Catch ex As Exception
        BRApi.ErrorLog.LogMessage(si, "Erro3: " & ex.Message)
    End Try 
    
    listTargetDC.Clear
Next