GetFormulaData(FormulaKey: Integer; [Options: DictionaryGetDataOptions = 0]): IRubricatorFormulaData;
FormulaKey. Key of the formula, which data must be obtained.
Options. Parameter of getting data. Optional parameter. Default value - DictionaryGetDataOptions.None (getting data for reading).
The GetFormulaData method returns formula data by the specified key.
Executing the example requires that the repository contains a time series database with the OBJ_RUBRICATOR identifier. A time series database must contain a formulas dictionary.
Sub Main;
Var
mb: IMetabase;
Rub: IMetabaseObject;
RubInst: IRubricatorInstance;
formulaData: IRubricatorFormulaData;
Begin
mb := MetabaseClass.Active;
Rub := mb.ItemById("OBJ_RUBRICATOR").Edit;
RubInst := Rub.Open(Null) As IRubricatorInstance;
formulaData := RubInst.GetFormulaData(1);
If formulaData <> Null
Then
Debug.WriteLine(formulaData.FormulaXML);
Else Debug.WriteLine(Formula with this key does not exist);
End If;
End Sub Main;
After executing the example the console window displays XML code of formula with the 1 key.
See also: