IRdsDictionaryElement.InsertChild

Syntax

InsertChild(Data: IRdsDictionaryElementData): IRdsDictionaryElement;

Parameters

Data. New element data.

Description

The InsertChild method creates a new child element for this element. A new element is created on the base of data passed by the Data parameter and added to the end of the whole branch of child elements.

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;

Attrs: IRdsAttributes;

Dict: IRdsDictionary;

DictInst: IRdsDictionaryInstance;

Elements: IRdsDictionaryElements;

Element: IRdsDictionaryElement;

Data: IRdsDictionaryElementData;

Begin

MB := MetabaseClass.Active;

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

Attrs := Dict.Attributes;

DictInst := Dict.Open(Null);

Elements := DictInst.Elements;

Element := Elements.Item(1);

Data := Elements.CreateElementData;

Data.Attribute(Attrs.Name.Key) := New element;

Element.InsertChild(Data);

End Sub Main;

After executing the example one child element is created for the first element.

See also:

IRdsDictionaryElement