IDimLevels.FindByKey

Syntax

FindByKey(IndexKey: Integer): IDimLevel;

Parameters

IndexKey. Key of dictionary level on which the search will be based.

Description

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

Example

Sub Main;

Var

MB: IMetabase;

DimModel: IDimensionModel;

Levels: IDimLevels;

Level: IDimLevel;

s: String;

Begin

MB:=MetabaseClass.Active;

DimModel:=MB.ItemById("D_TO").Bind As IDimensionModel;

Levels:=DimModel.Levels;

If Levels.Count<>0 Then

Level:=Levels.FindByKey(4000);

If Level<>Null Then

s:=Level.Name;

End If;

End If;

End Sub Main;

After executing the example the method searches for the dictionary level with the key 4000. If the level is found, the "s" variable shows its name. Repository object identifier: D_TO.

See also:

IDimLevels