Forum Discussion

Marco's avatar
Marco
Contributor II
22 days ago

How to pass parameters through ExecuteCustomCalculateBusinessRule

Hi Everyone.

I am trying to run a CustomCalculateBR in another BR, and I have the following for the variable namevaluepairs, but I would also like to pass parameters in this BR. I have been investigating but did not find a solution. Similarly, I would like to ask if passing with .base will work the same way as if it were in a step or not. I would appreciate it if you could help me.

Dim mvp As New Dictionary(Of String,String)
mvp.Add("Cube","HLFPLN")
mvp.Add("Entity",strEntTx1)
mvp.Add("Consolidation","Local")
mvp.Add("Scenario","|WFScenario|")
mvp.Add("Time","T#|!PLN_ParamFcstMths!|")
mvp.Add("View","None")
mvp.Add("Flow","None")
mvp.Add("IC","None")
mvp.Add("UD5","None")
mvp.Add("UD6","None")
mvp.Add("UD7","None")
mvp.Add("UD8","None")
mvp.Add("Parameters","test=ValueTest")
BRApi.Finance.Calculate.ExecuteCustomCalculateBusinessRule(si,"PLN_ThreeMonths2","Test",mvp,CustomCalculateTimeType.MemberFilter)

 

  • RobbSalzmann's avatar
    RobbSalzmann
    Valued Contributor II

    Hi Marcus,

    You can use substitution variables like |WFScenario| in a member script.  You cannot pass a parameter however since parameters are often user facing/ runtime set.  You would have to parse the parameter for its current value and use that.


  • MarcusH's avatar
    MarcusH
    Contributor III

    What you have looks OK. The only thing I would check is that the Time dimension member does not have T# in the Test BR - all the other dimensions do not have the dimension token specified. The MarketPlace application CPM BluePrint (available in OpenPlace) has an example in the Dashboard Extender DFM_SolutionHelper.

    • Marco's avatar
      Marco
      Contributor II

      Hi Marcus.

      Thank you for responding, but I do not have the CPM BluePrint application integrated. What I want to achieve with this is to execute a setdatacell or a calculatedata in the other business rule to assign values according to my first BR. Therefore, I need to see what I have to do for it to work as if it were a Step and for this process to function correctly.

      api.Data.SetDataCell("E#M_S_CZECH:S#[" & strScenario & "]:T#" & strTime &":V#Periodic:A#S_ConvFactorInner:F#None:O#Forms:I#None:U1#D0000:U2#P0000:U3#LOCAL_DATA:U4#PJ00000:U5#None:U6#None:U7#None:U8#None", totAll,True)
      
      api.Data.Calculate("S#[" & strScenario & "]:T#" & strTime & ":E#" & strEntity & ":A#S_ConvFactorInner:O#Forms:I#None:U1#D0000:U2#P0000:U3#LOCAL_DATA:U4#PJ00000 = (S#[ForecastInput]:T#" & strTime & ":E#" & valEntity & ":A#S_ConvFactorInner:O#Forms:U1#D0000:U2#P0000:U3#LOCAL_DATA:U4#PJ00000)*1",False)