IRubricatorFormulasLookup.WhereParentKey

Fore Syntax

WhereParentKey: Integer;

Fore.NET Syntax

WhereParentKey: uinteger;

Description

The WhereParentKey property determines key of the parent formula, by which search is executed.

Comments

Key of the parent formula is determined by the IRubricatorFormulaData.ParentKey property.

Fore Example

Executing the example requires that the repository contains a time series database with the the FC_COMM identifier. Also, add links to the Metabase, Cubes system assemblies.

Sub UserProc;
Var
    mb: IMetabase;
    Rub: IMetabaseObject;
    RubInst: IRubricatorInstance;
    ForLoo: IRubricatorFormulasLookup;
    formulaData: IRubricatorFormulaData;
Begin
    mb := MetabaseClass.Active;
    Rub := mb.ItemById("FC_COMM").Edit;
    RubInst := Rub.Open(NullAs IRubricatorInstance;
    ForLoo := RubInst.CreateFormulasLookup;
    ForLoo.WhereParentKey := 452233;
    formulaData := ForLoo.LookupData;
    If formulaData <> Null
        Then Debug.WriteLine(Formula was found. Type:  + formulaData.Kind.ToString);
        Else Debug.WriteLine(Formula was not found);
    End If;
End Sub UserProc;

Executing the example creates an object that searches in the time series database for the formula, which parent formula has the 452233 key. If the formula is found, the value of the found formula type is displayed in the console window.

Fore.NET Example

Executing the example requires that the repository contains a time series database with the the FC_COMM identifier.

Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Rds;

Public Shared Sub Main(Params: StartParams);
Var
    mb: IMetabase;
    Rub: IMetabaseObject;
    RubInst: IRubricatorInstance;
    ForLoo: IRubricatorFormulasLookup;
    formulaData: IRubricatorFormulaData;
    s: String;
Begin
    mb := Params.Metabase;
    Rub := mb.ItemById["FC_COMM"].Edit();
    RubInst := Rub.Open(NullAs IRubricatorInstance;
    ForLoo := RubInst.CreateFormulasLookup();
    ForLoo.WhereParentKey := 452233;
    formulaData := ForLoo.LookupData(DictionaryGetDataOptions.dgdoNone);
    If formulaData <> Null
        Then
            s := (Formula was found. Type:  + formulaData.Kind.ToString());
        Else
            s := (Formula was not found);
    End If;
End Sub;

Executing the example creates an object that searches in the time series database for the formula, which parent formula has the 452233 key. If parameters are found, the value of the found formula type is saved in the "s" variable.

See also:

IRubricatorFormulasLookup