Forum Discussion

fc's avatar
fc
New Contributor III
2 years ago

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 ...
  • RobbSalzmann's avatar
    2 years ago

    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")

  • fc's avatar
    2 years ago

    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 If

    I 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 If

     The rest of the script is structured as Rob suggested.

    Thank you all for the help!