Dimensions > Dimensions Assembly Interfaces > IUserDimLevels > IUserDimLevels.FindByKey
FindByKey(IndexKey: Integer): IUserDimLevel;
IndexKey. Key of the dictionary level, by which search is executed.
The FindByKey method searches and returns the object containing calculated dictionary level.
Sub UserProc;
Var
MB: IMetabase;
UsDim: IUserDimension;
UsDimLevs: IUserDimLevels;
UsDimLevel: IUserDimLevel;
s: String;
Begin
MB:=MetabaseClass.Active;
UsDim:=MB.ItemById("USER_DIM").Bind As IUserDimension;
UsDimLevs:=UsDim.Levels;
UsDimLevel:=UsDimLevs.FindByKey(5352);
If UsDimLevel<>Null Then
s:=UsDimLevel.Name;
End If;
End Sub UserProc;
After executing the example the method searches for the dictionary level with the 5352 key, and if the search is successful the "i' variable contains the name of the level found. Calculated dictionary identifier - USER_DIM.
See also: