IDimAttributesInstance.FindById

Syntax

FindById(AttributeId: String): IDimAttributeInstance;

Parameters

AttributeId - ID of dictionary attribute on which the search is based.

Description

The FindById method searches for attribute by identifier and returns object containing dictionary attribute.

Example

Executing the example requires that the repository contains a dictionary with the D_TO identifier.

Sub UserProc;
Var
    MB: IMetabase;
    Dimen: IDimInstance;
    Attrs: IDimAttributesInstance;
    Attr: IDimAttributeInstance;
    i: Integer = -1;
Begin
    MB := MetabaseClass.Active;
    Dimen := MB.ItemById("D_TO").Open(NullAs IDimInstance;
    Attrs := Dimen.Attributes;
    Attr := Attrs.FindById("ID");
    If Attr <> Null Then
        i := Attr.Attribute.Key;
    End If;
End Sub UserProc;

After executing the example the attribute with the identifier ID is searched for, and in case of success the "i" variable contains key of the found attribute, otherwise the variable contains -1.

See also:

IDimAttributesInstance