Selection changed POV Arguments

Yaseen
New Contributor III

hello -

I have the Workflow start time and Workflow end time set on the Scenario. I am trying to change WF POV from Dashboard component Combo box by passing Scenario as parameter. scenario is changing but the year is not, i need workflow start year dynamically updated along with scenario. Any inputs on how to get the Workflow start year changed along with Scenario is appreciated.

 

below are my settings under Actions section

Selection changed POV Action: Change Workflow

Selection changed POV Arguments: WFScenario=|!MyWFScenario!|

5 REPLIES 5

EricOsmanski
Valued Contributor

You should be able to do this with a BRString. I tested the below and it was successful:

WFProfile=WFProfileName, WFScenario=ScenarioName, WFTime=XFBR(RuleName,GetWorkflowStartTime)

In a Dashbaord XFBRString BR:

If (args.FunctionName.Equals("RuleName", StringComparison.InvariantCultureIgnoreCase)) Then
Dim scenarioId As Integer = BRApi.Finance.Members.GetMemberId(si, DimType.Scenario.Id, "ScenarioName")
Dim wfStartTime As Integer = brapi.Finance.Scenario.GetWorkflowStartTime(si, scenarioId)
Dim wfStartYear As Integer = BRApi.Finance.Time.GetYearFromId(si, wfStartTime)
Return BRApi.Finance.Time.GetNameFromId(si, wfStartYear)
End If

You can make this more dynamic by passing in the scenario to the BR using a parameter, variable, etc, but did not for the simple purpose of showing how it could work.

Yaseen
New Contributor III

@EricOsmanski , thanks much for sharing. For some reason for me the XFBRString BR is not executing. I tried passing Business rule name, along with Function name and variable name with no luck. I tried different ways but couldn't make it work. Any tips much appreciated.

Krishna
Valued Contributor

It is working for me as well, I passed the below in the ComboBox. 

WFProfile=|!CC_PARAM_WF!|,WFScenario=Forecast,WFTime=XFBR(WFPOV,GetWorkflowStartTime)

I think the issue is when you are making Scenario as a dropdown then it is not working. 

 

Hope this helps,

 

Thanks
Krishna

EricOsmanski
Valued Contributor

Are you able to post what you have in the selection changed arguments and also your XFBR rule? If I can see the details, I will be able to better assist you.

Yaseen
New Contributor III

@Krishna , thank you. my requirement is to provide scenario as the drop down and that should trigger the workflow time change.

@EricOsmanski thank you, below is what I am using

WFProfile=Manufacturing, WFScenario=|!TargetScenario!|, WFTime(ChangeWFTime,GetWorkflowStartTime)

If (args.FunctionName.Equals("ChangeWFTime", StringComparison.InvariantCultureIgnoreCase)) Then
Dim sScenarioName As String = "TargetScenario"
Dim parameterValue As String = ""
parameterValue = BRApi.Dashboards.Parameters.GetLiteralParameterValue(si, False, sScenarioName)
brapi.ErrorLog.LogMessage(si, "parameterValue: " & parameterValue)
Dim scenarioId As Integer = BRApi.Finance.Members.GetMemberId(si, DimType.Scenario.Id, "parameterValue")
Dim wfStartTime As Integer = brapi.Finance.Scenario.GetWorkflowStartTime(si, scenarioId)
Dim wfStartYear As Integer = BRApi.Finance.Time.GetYearFromId(si, wfStartTime)
Return BRApi.Finance.Time.GetNameFromId(si, wfStartYear)
End If