bool DashboardCalcFactApply(string mon, DashboardCalcFactApplyArg tArg)
mon. Information panel data source moniker.
tArg. Operation execution parameters.
The DashboardCalcFactApply operation applies the changes made in calculated fact formula.
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.
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.
{
"DashboardCalcFactApply" :
{
"mon" : "LKACHLFPHPFFGOAEFAJMIHOHCKLEPLKEEIENANDBMODOBJMH!M!S!PHOONDMFPHPFFGOAEGILOHDKLDDEDFAAEEJAAJAMKHGKPJBCK!Sources!1",
"tArg" :
{
"expression" :
{
"k" : "1",
"formula" : "@[FIELD 3]\/2"
}
}
}
}
{
"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: