Skip to main content
February 18, 2025
Solved

Table view service - get customSubstVars inside SaveTableView function

  • February 18, 2025
  • 1 reply
  • 0 views

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?

Best answer by MarcR

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

1 reply

MarcRAnswer
February 18, 2025

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òAuthor
February 18, 2025

Hi MarcR,

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

Thanks, 

Niccolò

February 18, 2025

Hi Niccolo, i use a speadsheet BR