IRdsAttributes.ParentKey

Syntax

ParentKey: IRdsAttribute;

Description

The ParentKey property returns a system attribute of a dictionary, which assignment is Key of Owner Element.

Comments

This attribute has integer type, can contain empty values and cannot contain multiple values. It is hidden by default. The attribute identifier is PARENT_KEY. This attribute is available if the Hierarchical property is set to True, and it is used to fix changes of attribute values.

Example

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

Sub Main;

Var

MB: IMetabase;

Dict: IRdsDictionary;

DictInst: IRdsDictionaryInstance;

Elements: IRdsDictionaryElements;

Attrs: IRdsAttributes;

i, j: Integer;

Begin

MB := MetabaseClass.Active;

Dict := MB.ItemByIdNamespace("Dict_1", MB.ItemById("NSI_1").Key).Bind As IRdsDictionary;

Attrs := Dict.Attributes;

j := Attrs.ParentKey.Key; // attribute key

DictInst := Dict.Open(Null);

Elements := DictInst.Elements;

For i := 1 To Elements.Count - 1 Do

Debug.WriteLine(Elements.Item(i).Attribute(j));

End For;

End Sub Main;

After executing the example values of the Owner attribute are displayed in the console for all dictionary elements.

See also:

IRdsAttributes