IRdsDictionaryElements.Attribute

Syntax

Attribute(Element: Integer; AttributeKey: Integer): Variant;

Parameters

Element. Key of the element, for which attribute value should be obtained.

AttributeKey. Key of the attribute, which value should be obtained.

Description

The Attribute property returns the name of the specified attribute for the set MDM dictionary element.

Comments

By default only values of system attributes are available. To get values of system and custom attributes, set the IRdsDictionaryInstance.FetchAll property to True.

Example

Executing the example requires that the repository contains an MDM dictionary with the EXP_DICT identifier.

Add links to the Metabase, Rds system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    Dict: IRdsDictionary;
    DictInst: IRdsDictionaryInstance;
    Elements: IRdsDictionaryElements;
    Attrs: IRdsAttributes;
    i, El, AttrKey: Integer;
Begin
    MB := MetabaseClass.Active;
    Dict := MB.ItemById("EXP_DICT").Bind As IRdsDictionary;
    Attrs := Dict.Attributes;
    AttrKey := Attrs.Name.Key; // attribute key
    DictInst := Dict.Open(Null);
    Elements := DictInst.Elements;
    For i := 0 To Elements.RootItem.ChildrenCount - 1 Do
        El := Elements.Child(Elements.Root, i);
        Debug.WriteLine(Elements.Attribute(El, AttrKey));
    End For;
End Sub UserProc;

After executing the example, value of the Name attribute is displayed in the development environment console for all dictionary root elements.

See also:

IRdsDictionaryElements