DashboardCalcFactApply

Syntax

bool DashboardCalcFactApply(string mon, DashboardCalcFactApplyArg tArg)

Parameters

mon. Information panel data source moniker.

tArg. Operation execution parameters.

Description

The DashboardCalcFactApply operation applies the changes made in calculated fact formula.

Comments

To execute the operation, in the mon field specify moniker of opened information panel instance with the !Sources!data source key postfix, and in the tArg field specify the formula that should be set for calculated fact. The moniker can be obtained on executing the OpenDashboard operation.

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

Example

Below is the example of applying the changes made in the calculated facts formula. The request contains the moniker of information panel data source, calculated fact key, and the new formula. The response contains whether changes were applied 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">
<DashboardCalcFactApply xmlns="http://www.fsight.ru/PP.SOM.Som">
  <mon xmlns="">LKACHLFPHPFFGOAEFAJMIHOHCKLEPLKEEIENANDBMODOBJMH!M!S!PHOONDMFPHPFFGOAEGILOHDKLDDEDFAAEEJAAJAMKHGKPJBCK!Sources!1</mon>
<tArg xmlns="">
<expression>
  <k>1</k>
  <formula>@[FIELD 3]/2</formula>
  </expression>
  </tArg>
  </DashboardCalcFactApply>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
  <DashboardCalcFactApplyResult 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</DashboardCalcFactApplyResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"DashboardCalcFactApply" :
{
"mon" : "LKACHLFPHPFFGOAEFAJMIHOHCKLEPLKEEIENANDBMODOBJMH!M!S!PHOONDMFPHPFFGOAEGILOHDKLDDEDFAAEEJAAJAMKHGKPJBCK!Sources!1",
"tArg" :
{
"expression" :
{
"k" : "1",
"formula" : "@[FIELD 3]\/2"
}
}
}
}

JSON response:

{
"DashboardCalcFactApplyResult" : "1"
}
public static bool DashboardCalcFactApply(string moniker, uint sourceKey, uint calcFactKey, string newExpression)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tApply = new DashboardCalcFactApply()
{
tArg = new DashboardCalcFactApplyArg()
{
expression = new DashboardExpression()
{
formula = newExpression,
k = (int)calcFactKey
}
},
// Moniker for working with relations
mon = moniker + "!Sources!" + sourceKey
};
// Undo changes in relation settings
var result = somClient.DashboardCalcFactApply(tApply);
return result;
}

See also:

Working with Information Panels