Literal parameters and multiple users
Hi all,
I'm currently developing a dashboard that will likely be used by multiple users at the same time.
Users will be able to set some initial parameters within the dashboard, and click on a button that will trigger a BR that will return some output rows within a table in the database.
After the process is complete, the user will be able to see the output rows through the following SQL Table Editor:
the parameters that you can see in the "Where Clause" are literal parameters that are set from within the BR when it is triggered by the user (using BRApi.Dashboards.Parameters.SetLiteralParameterValue()), and their value depend on the initial parameters that the user selected in the dashboard.
The problem is, I saw in some posts within the forum that literal parameters are "common" to all users, so every time one user will click the button and launch the process, the literal parameters will be changed. This is a problem, because we expect users to use the dashboard simultaneously.
Is there a workaround that does not use literal parameters? Or is there a way to make literal parameters "unique" to every user?
Thanks in advance!
Literal Parameters values are application-wide, session inspecfic. Things like formats and colors work well in Literal parameters
For user/session specific parameters, use Input Parameters:
In your code, these Input Parameters are oddly named "ModifiedSubVars". You change the value of the ModifiedSubVars on the returned Task Result object, e.g. XFLoadDashboardTaskResult, XFSelectionChangedTaskResult depending on what event you're handling. Be sure to also set one or all of the ChangeCustomSubstVarsIn properties to True.
E.g.selectionChangedTaskResult.ChangeCustomSubstVarsInDashboard = True
selectionChangedTaskResult.ModifiedCustomSubstVars.Add("pm_myParameter_Name", "User Specific Value")It finally works! The problem was that the popup came out every time the dashboard refreshed, thus every time this section of the script was triggered:
Case Is = DashboardExtenderFunctionType.LoadDashboard
If args.FunctionName.XFEqualsIgnoreCase("LoadFunction") Then
.....
End IfI managed to avoid the pop up to come out by adding a couple of lines of code:
Case Is = DashboardExtenderFunctionType.LoadDashboard
If args.FunctionName.XFEqualsIgnoreCase("LoadFunction") Then
loadDashboardTaskResult.ChangeCustomSubstVarsInDashboard = True
If Not(args.LoadDashboardTaskInfo.CustomSubstVarsFromPriorRun.XFGetValue("p_RowEntityList").Equals("None")) Then
loadDashboardTaskResult.ModifiedCustomSubstVars.Add("p_RowEntityList", args.LoadDashboardTaskInfo.CustomSubstVarsFromPriorRun.XFGetValue("p_RowEntityList"))
loadDashboardTaskResult.ModifiedCustomSubstVars.Add("p_RowAccList", args.LoadDashboardTaskInfo.CustomSubstVarsFromPriorRun.XFGetValue("p_RowAccList"))
loadDashboardTaskResult.ModifiedCustomSubstVars.Add("p_RowDocList", args.LoadDashboardTaskInfo.CustomSubstVarsFromPriorRun.XFGetValue("p_RowDocList"))
Return loadDashboardTaskResult
Else
loadDashboardTaskResult.ModifiedCustomSubstVars.Add("p_RowEntityList", "None")
loadDashboardTaskResult.ModifiedCustomSubstVars.Add("p_RowAccList", "None")
loadDashboardTaskResult.ModifiedCustomSubstVars.Add("p_RowDocList", "None")
Return loadDashboardTaskResult
End If
End IfThe rest of the script is structured as Rob suggested.
Thank you all for the help!