IDimAttributesInstance.FindByKey

Syntax

FindByKey(AttributeKey: Integer): IDimAttributeInstance;

Parameters

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

Description

The FindByKey method searches an object containing dictionary attribute by attribute key.

Example

Sub UserProc;
Var
    MB: IMetabase;
    Dimen: IDimInstance;
    Attrs: IDimAttributesInstance;
    Attr: IDimAttributeInstance;
    s: String;
Begin
    MB:=MetabaseClass.Active;
    Dimen:=MB.ItemById("D_TO").Open(NullAs IDimInstance;
    Attrs:=Dimen.Attributes;
    Attr:=Attrs.FindByKey(100);
    If Attr<>Null Then
        s:=Attr.Attribute.Id;
    Else
        s:="The attribute is not found";
    End If;
End Sub UserProc;

After executing the example the method searches attribute with the key 100, and if the search is successful, the "s" variable contains identifier of the found attribute.

See also:

IDimAttributesInstance