Forum Discussion

Niccolò's avatar
Niccolò
New Contributor
20 days ago
Solved

Table view service - get customSubstVars inside SaveTableView function

Hi,

I need to use inside my Table View service some parameters that are bound to combo boxes in order to write a query, and execute it when the "SaveTableView" function is called. 

Unlike the "GetTableView" function, 

SaveTableView's signature doesn't provide a parameter that contains all substitution variables (Dictionary<string, string> customSubstVars for GetTableView)

I also tried setting the customSubstVars dictionary into the BRGlobals from the GetTableView function, but once you try getting the dictionary from the globals, it returns null.

Is there no way of getting this customSubstVars dictionary to use it inside SaveTableView?

  • Hi Niccolo, 

    i haven't found the solution but i use a workaround which might help you. 

    in my Get function i pick up the parameter and store it in my tableview on each row:

    If args.CustSubstVarsAlreadyResolved.ContainsKey("prm_xxx")
    	sEntity = args.CustSubstVarsAlreadyResolved("prm_xxx")

    and i insert this in my datatable in the column ReportingEntity (in my case)

    in my Save function i retrieve this value from the tableview again:

    'get Entity from first tblView row
    	sEntity = tblView.Rows(1).Item("ReportingEntity").value

    and store it in the database in my SQL statement.

    Hope this helps

  • Hi Niccolo, 

    i haven't found the solution but i use a workaround which might help you. 

    in my Get function i pick up the parameter and store it in my tableview on each row:

    If args.CustSubstVarsAlreadyResolved.ContainsKey("prm_xxx")
    	sEntity = args.CustSubstVarsAlreadyResolved("prm_xxx")

    and i insert this in my datatable in the column ReportingEntity (in my case)

    in my Save function i retrieve this value from the tableview again:

    'get Entity from first tblView row
    	sEntity = tblView.Rows(1).Item("ReportingEntity").value

    and store it in the database in my SQL statement.

    Hope this helps

    • Niccolò's avatar
      Niccolò
      New Contributor

      Hi MarcR,

      this solution is implemented in the Spreadsheet BR or Dashboard Service associated with a maintenance unit?

      Thanks, 

      Niccolò