DashboardFormulaEditorApply

Syntax

bool DashboardFormulaEditorApply(string mon, string tArg)

Parameters

mon. Information panel element moniker.

tArg. New expression that should be applied.

Description

The DashboardFormulaEditorApply operation applies changes to information panel element or data model element edited in the expression editor.

Comments

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:

The operation results in the logical true if changes were applied successfully.

Example

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.

SOAP request:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<DashboardFormulaEditorApply xmlns="http://www.fsight.ru/PP.SOM.Som">
  <mon xmlns="">JGFBABFGGBCDGOAEBMHDIAHPJIKJBODEGIEMDGCEMLPABPHA!M!S!PAKKBPCFGGBCDGOAEPJJNAKJDEPCJOIOEJLMIGOFHBOBCOFGO!Sources!Queries!Elements!1!Ufe</mon>
  <tArg xmlns="">select * from T_LOG_MESSAGES</tArg>
  </DashboardFormulaEditorApply>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
  <DashboardFormulaEditorApplyResult xmlns="http://www.fsight.ru/PP.SOM.Som" xmlns:q1="http://www.fsight.ru/PP.SOM.Som" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">1</DashboardFormulaEditorApplyResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"DashboardFormulaEditorApply" :
{
"mon" : "JGFBABFGGBCDGOAEBMHDIAHPJIKJBODEGIEMDGCEMLPABPHA!M!S!PAKKBPCFGGBCDGOAEPJJNAKJDEPCJOIOEJLMIGOFHBOBCOFGO!Sources!Queries!Elements!1!Ufe",
"tArg" : "select * from T_LOG_MESSAGES"
}
}

JSON response:

{
"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:

Working with Information Panel