IStandardDimLevels.FindByKey

Syntax

FindByKey(IndexKey: Integer): IStandardDimLevel;

Parameters

IndexKey.Key of the level, by which search is executed.

Description

The FindByKey method searches and returns the object containing table dictionary level. Search is executed by the key passed by the IndexKey parameter.

Example

Sub UserProc;
Var
    MB: IMetabase;
    Dim: IStandardDimension;
    DimLevels: IStandardDimLevels;
    DimLevel: IStandardDimLevel;
    s: String;
Begin
    MB:=MetabaseClass.Active;
    Dim:=MB.ItemById("TAB_DIM").Bind As IStandardDimension;
    DimLevels:=Dim.Levels;
    If DimLevels.Count<>0 Then
        DimLevel:=DimLevels.FindByKey(4896);
        If DimLevel<>Null Then
            s:=DimLevel.Name;
        Else
            s:="It is not found";
        End If;
    End If;
End Sub UserProc;

After executing the example the method searches for the level with the 4896 key, and if the search is successful, the "s" variable contains the name of the found level. Table dictionary identifier: TAB_DIM.

See also:

IStandardDimLevels