Forum Discussion
BenEppel
13 hours agoNew Contributor II
Hello,
If you want to default the parameter to today's date, and also be able to manually change the parameter, you'll want to use a dashboard extender rule. This rule allows you to set parameters on dashboard load.
Create a new Dashboard Extender rule and find where it says Case Is = DashboardExtenderFunctionType.LoadDashboard. Below that replace "TestFunction" with your function name, change this loadDashboardTaskResult.ChangeCustomSubstVarsInDashboard to True, and add in the logic you would like to get today's date like below. YourParamName also needs to be replaced with the name of your dashboard parameter.
Public Function Main(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Object, ByVal args As DashboardExtenderArgs) As Object
Try
Select Case args.FunctionType
Case Is = DashboardExtenderFunctionType.LoadDashboard
If args.FunctionName.XFEqualsIgnoreCase("YourFunctionName") Then 'Replace Name
'Implement Load Dashboard logic here.
If args.LoadDashboardTaskInfo.Reason = LoadDashboardReasonType.Initialize And args.LoadDashboardTaskInfo.Action = LoadDashboardActionType.BeforeFirstGetParameters Then
Dim loadDashboardTaskResult As New XFLoadDashboardTaskResult()
loadDashboardTaskResult.ChangeCustomSubstVarsInDashboard = True 'Make sure it is set to True
loadDashboardTaskResult.ModifiedCustomSubstVars = Nothing
Dim TodaysDate As String = System.DateTime.Now.ToString 'Example logic, might need some formatting changes
loadDashboardTaskResult.ModifiedCustomSubstVars.Add("YourParamName", TodaysDate) 'Update with your parameter
Return loadDashboardTaskResult
End If
End If
Place your business rule in the highlighted area below
Place the rule on the main dashboard pane that is being ran.
Thanks,
Ben
Related Content
- 4 months ago
- 2 years ago