Forum Discussion
4 Replies
- SamRichards
OneStream Employee
Hey Darryl,
Yea you can do it, it would be done via a dashboard extender rule, and you can set the parameter to whatever value you want. Let me know if you want a sample of the code to do it and I will find and example.
Thanks
- drgerrowNew Contributor III
Hi Sam - yes, would appreciate seeing a quick sample if you have one available!
- SamRichards
OneStream Employee
Here you go. This example is using literal parameters to set the combo boxes but you could pass through parameters on the extender call to do it instead of the literal parameters. Also at the top of this call it will only run this rule on the intial load of the dashboard which I believe is what you would want to do.
Case Is = DashboardExtenderFunctionType.LoadDashboard
If (args.FunctionName.XFEqualsIgnoreCase("OnLoadWaterFallDashboard")) Then
If args.LoadDashboardTaskInfo.Reason = LoadDashboardReasonType.Initialize And args.LoadDashboardTaskInfo.Action = LoadDashboardActionType.BeforeFirstGetParameters Then' Or LoadDashboardReasonType.ComponentSelectionChanged Then ' 'Initialize Message
Dim loadDashboardTaskResult As New XFLoadDashboardTaskResult()
loadDashboardTaskResult.ChangeCustomSubstVarsInDashboard = True
Dim Comp2Scn As String = BRApi.Dashboards.Parameters.GetLiteralParameterValue(si, False, "Param_Water_LiteralSelectComp2Scn")
Dim Comp2Time As String = BRApi.Dashboards.Parameters.GetLiteralParameterValue(si, False, "Param_Water_LiteralSelectComp2Time")
Dim Comp1Scn As String = BRApi.Dashboards.Parameters.GetLiteralParameterValue(si, False, "Param_Water_LiteralSelectComp1Scn")
Dim Comp1Time As String = BRApi.Dashboards.Parameters.GetLiteralParameterValue(si, False, "Param_Water_LiteralSelectComp1Time")
Dim CurScn As String = BRApi.Dashboards.Parameters.GetLiteralParameterValue(si, False, "Param_Water_LiteralSelectCurScn")
Dim CurTime As String = BRApi.Dashboards.Parameters.GetLiteralParameterValue(si, False, "Param_Water_LiteralSelectCurTime")
'Brapi.ErrorLog.LogMessage(si, Comp2Scn & Comp2Time &Comp1Scn &Comp1Time &CurScn &CurTime )
loadDashboardTaskResult.ModifiedCustomSubstVars.Add("Param_GPS_SelCompFCast", Comp1Scn)
loadDashboardTaskResult.ModifiedCustomSubstVars.Add("Param_GPS_SelCompFcstTimeMth", Comp1Time)
loadDashboardTaskResult.ModifiedCustomSubstVars.Add("Param_GPS_SelComp2FCast", Comp2Scn)
loadDashboardTaskResult.ModifiedCustomSubstVars.Add("Param_GPS_SelComp2FcstTimeMth", Comp2Time)
loadDashboardTaskResult.ModifiedCustomSubstVars.Add("Param_SelectCurFcst", CurScn)
loadDashboardTaskResult.ModifiedCustomSubstVars.Add("Param_SelectCurFcstTimeMth", CurTime)
Return loadDashboardTaskResult
End If
End IfTHanks,
Is setting a default on a parameter not working? If not, then you'll have to go with the extender route of setting the parameter while launching it.
Related Content
- 3 months ago
- 11 months ago