IUserDimIndexAttributes.FindByKey

Syntax

FindByKey(AttributeKey: Integer): IUserDimAttribute;

Parameters

AttributeKey - key of the attribute on which the search is based.

Description

The FindByKey method searches and returns an object containing the attribute of the calculated dictionary used the base to create index. The key attribute of which is searched for is passed by the AttributeKey parameter.

Example

Sub Main;

Var

MB: IMetabase;

UsDim: IUserDimension;

UsDimInds: IUserDimIndexes;

UsDimIndex: IUserDimIndex;

IndexAtr: IUserDimIndexAttributes;

UsDimAtr: IUserDimAttribute;

s: String;

Begin

MB:=MetabaseClass.Active;

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

UsDimInds:=UsDim.Indexes;

If UsDimInds.Count<>0 Then

UsDimIndex:=UsDimInds.Item(0);

IndexAtr:=UsDimIndex.Attributes;

UsDimAtr:=IndexAtr.FindByKey(5228);

If UsDimAtr<>Null Then

s:=UsDimAtr.Name;

End If;

End If;

End Sub Main;

After executing the example the method searches for the attribute with the 5228 key used as the base to create index. If the attribute is found, the "s" variable shows its name. Calculated dictionary identifier: USER_DIM.

See also:

IUserDimIndexAttributes