IRdsDictionaryElement.SetParent

Syntax

SetParent(Parent: IRdsDictionaryElement);

Parameters

Parent. Element that is necessary to set as a parent.

Description

The SetParent method changes a parent element for a current element.

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;

Element1, Element2: IRdsDictionaryElement;

Begin

MB := MetabaseClass.Active;

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

DictInst := Dict.Open(Null);

Elements := DictInst.Elements;

Element1 := Elements.Item(1);

Element2 := Elements.Item(Elements.Count - 1);

Element1.SetParent(Element2);

End Sub Main;

After executing the example the last element is set as a parent one for the first root element of a dictionary.

See also:

IRdsDictionaryElement