Solved
Forum Discussion
Gidon_Albert
2 years agoContributor II
We get around the repetitive execution of BRs assigned to the "Load Dashboard Server Task (Once)" by using the args.LoadDashboardTaskInfo.Reason function. This function returns zero the first time the dashboard is launched and adds "1" on every subsequent refresh. So the following code lets the BR execute only on the initial DB load:
Public Function Initiate_EXD(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Object, ByVal args As DashboardExtenderArgs) As XFSelectionChangedTaskResult
Try
'Run the Initiation code only on the initial launch of the dashboard
If args.LoadDashboardTaskInfo.Reason > 0 Then GoTo GetOut
'Do stuff here for the first time the Dashboard is loaded
GetOut:
Catch ex As Exception
Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
End Try
End Function
Here are the steps:
Call the Set the Load Dashboard Server Task BR to run Once:
Call the function from Main:
At the top of the function, check to see if the Reason is more than zero. If it is, skip all the code and get out:
Related Content
- 5 days ago
- 31 days ago
- 3 months ago