FindByKey(IndexKey: Integer): IDimIndexInstance;
IndexKey — index key on which the search is based.
The FindByKey method searches and returns an object containing dictionary index. Search is executed by the key passed by the IndexKey parameter.
Sub UserProc;
Var
MB: IMetabase;
Dimen: IDimInstance;
Indxs: IDimIndexesInstance;
Index: IDimIndexInstance;
s: String;
Begin
MB:=MetabaseClass.Active;
Dimen:=MB.ItemById("D_TO").Open(Null) As IDimInstance;
Indxs:=Dimen.Indexes;
If Indxs.Count<>0 Then
Index:=Indxs.FindByKey(4903);
If Index<>Null Then
s:=Index.Index.Id;
End If;
End If;
End Sub UserProc;
After executing the example the method searches for index with the 4903 key, and the "s" variable contains the identifier of the found index if the search is successful.
See also: