bool DashboardFormulaEditorApply(string mon, string tArg)
mon. Information panel element moniker.
tArg. New expression that should be applied.
The DashboardFormulaEditorApply operation applies changes to information panel element or data model element edited in the expression editor.
The operation saves SQL queries, calculated field expressions, and data model table filtering. To execute the operation, in the mon field specify moniker of edited element, and in the tArg field specify new expression for the element.
The moniker is created from moniker of opened information panel instance or data model with adding the following postfixes:
!Sources!Queries!Elements!query key!Ufe. To work with SQL queries.
!Fields!field key!Ufe. To work with calculated fields.
!Ufe. To set up filtering in data model table.
The operation results in the logical true if changes were applied successfully.
Below is the example of changing SQL query text in data model. The request contains moniker of SQL query saved in data model and new text for SQL query. The response contains whether SQL query text was changed successfully.
{
"DashboardFormulaEditorApply" :
{
"mon" : "JGFBABFGGBCDGOAEBMHDIAHPJIKJBODEGIEMDGCEMLPABPHA!M!S!PAKKBPCFGGBCDGOAEPJJNAKJDEPCJOIOEJLMIGOFHBOBCOFGO!Sources!Queries!Elements!1!Ufe",
"tArg" : "select * from T_LOG_MESSAGES"
}
}
{
"DashboardFormulaEditorApplyResult" : "1"
}
public static bool DashboardFormulaEditorApply(string moniker, uint elementkey, string newFormula)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tApply = new DashboardFormulaEditorApply()
{
tArg = newFormula,
// Element moniker
mon = moniker + "!Sources!Queries!Elements!" + elementkey + "!Ufe"
};
// Apply changes
var result = somClient.DashboardFormulaEditorApply(tApply);
return result;
}
See also: