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

Marco
Contributor

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

 

1 ACCEPTED SOLUTION

JackLacava
Community Manager
Community Manager

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.

View solution in original post

7 REPLIES 7

JackLacava
Community Manager
Community Manager

You might want to specify how you're triggering this rule. Is it a Custom Calculation? A dashboard extender ? Something else?

Is a dashboard extender

JackLacava
Community Manager
Community Manager

Ok. Can you post your Scenario configuration too? Forecast scenarios are often set with Range frequency; I suspect you can't bypass that from Dashboard Extenders executed in a Workflow step, you might have to use a Custom Calc instead.

JackLacava_0-1706546678292.png

 

Marco_0-1706546876364.png

 

JackLacava
Community Manager
Community Manager

Yeah that's what I thought. M9 falls into the "no input periods", so you can't write directly to it in a workflow context.

A workaround that I believe will work:

  1. Write your data to a temporary intersection in M10;
  2. trigger a Data Management job that will execute a Custom Calculation;
  3. Custom Calc will take the value from the M10 dummy intersection and copy it to M9;
  4. optionally you can then clear the dummy node, but tbh I'd leave it as it is to tally up things.

Note that this goes against the spirit of Workflow configurations, so from an auditing perspective it's not great - you're declaring in Scenario settings that workflows won't change previous periods, and then you do it anyway - but at least you should get some traces from the DM job (Custom Calcs often don't leave any trace).

Is there a way to change that noinput value in the BR?

JackLacava
Community Manager
Community Manager

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.