IUserDimIndexes.FindByKey

Syntax

FindByKey(IndexKey: Integer): IUserDimIndex;

Parameters

IndexKey — index key on which the search is based.

Description

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

Example

Sub Main;

Var

MB: IMetabase;

UsDim: IUserDimension;

UsDimInds: IUserDimIndexes;

UsDimIndex: IUserDimIndex;

s: String;

Begin

MB:=MetabaseClass.Active;

UsDim:=MB.ItemById("USER_DIM").Bind As IUserDimension;

UsDimInds:=UsDim.Indexes;

If UsDimInds.Count<>0 Then

UsDimIndex:=UsDimInds.FindByKey(5320);

If UsDimIndex<>Null Then

s:=UsDimIndex.Name;

End If;

End If;

End Sub Main;

After executing the example the method searches for the index with the 5320 key, and if the search is successful, the "s" variable contains the name of dictionary index found. Calculated dictionary identifier: USER_DIM.

See also:

IUserDimIndexes