IStandardDimLevels.FindByKey

Syntax

FindByKey(IndexKey: Integer): IStandardDimLevel;

Parameters

IndexKey. Level key on which the search is based.

Description

The FindByKey method searches and returns the object containing table dictionary level. The search is based on the key passed by the IndexKey parameter.

Example

Sub Main;

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 Main;

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

See also:

IStandardDimLevels