FindById(AttributeId: String): IDimAttributeInstance;
AttributeId - ID of dictionary attribute on which the search is based.
The FindById method searches for attribute by identifier and returns object containing dictionary attribute.
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(Null) As 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: