SetDataCells error: workflow settings do not allow input for Time member (not solved)
Hello again, it seems that the error was not completely corrected, so I have the same problem as my previous post.
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
'Value example: [Entity1: (Source Value -362,712.29 * PctSplit 100.00 %) * (Driver Value 1.00 / Driver Total 1.00) * FxRate 1.0000 * Alloc Sign 1]
Try
BRApi.Finance.Data.SetDataCells(dbConnFW, dbConnApp, listTargetDC)
Catch ex As Exception
BRApi.ErrorLog.LogMessage(si, "Erro3: " & ex.Message)
End Try
listTargetDC.Clear
Next
You can trigger the DM job from the rule, there are examples scattered across these forums. You can also try triggering the Custom Calc directly from a button, I've not tested it.
I don't think you'll be able to use direct data-manipulation APIs from a dashboard extender for those periods, if the Dashboard is executed as a Workspace step in Workflow, because (as you've seen) the Workflow controls will kick in.
Edit: sorry, re-reading, you mean changing the Scenario property that defines the noinput periods? That might trigger even worse things and force you to reset the scenario, losing all data for that Scenario in the year. Big no-no.