FindByKey(IndexKey: Integer): IDimLevel;
IndexKey. Key of dictionary level on which the search will be based.
The FindByKey method searches and returns object containing dictionary level. Search is executed by the key passed by the IndexKey parameter.
Sub UserProc;
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 UserProc;
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: