IRdsCompoundDictionaryElements.Copy

Syntax

Copy(SourceInstance: IRdsDictionaryInstance; SourceElement: Integer; DestinationParent: Integer): Integer;

Parameters

SourceInstance - data of a dictionary, from which copying is executed.

SourceElement - key of a copied element.

DestinationParent - key of an element in a composite dictionary, for which copied element is a child.

Description

The Copy method copies an element from a source dictionary into composite MDM dictionary.

Example

Executing the example requires an MDM repository NSI_1 that contains a composite MDM dictionary with the CompDict_1 identifier. This dictionary has a source dictionary.

Sub Main;

Var

MB: IMetabase;

CompDict: IRdsCompoundDictionary;

CompSource: IRdsCompoundDictionarySource;

DictInst, DictInst1: IRdsDictionaryInstance;

CompElements: IRdsCompoundDictionaryElements;

Elements: IRdsDictionaryElements;

Begin

MB := MetabaseClass.Active;

CompDict := MB.ItemByIdNamespace("CompDict_1", MB.ItemById("NSI_1").Key).Bind As IRdsCompoundDictionary;

CompSource := CompDict.Sources.Item(0);

DictInst := CompDict.Open(Null) As IRdsDictionaryInstance;

DictInst1 := CompSource.Source.Open(Null) As IRdsDictionaryInstance;

CompElements := DictInst.Elements As IRdsCompoundDictionaryElements;

Elements := DictInst1.Elements;

CompElements.Copy(DictInst1, Elements.Item(1).Key, -2);

End Sub Main;

After executing the example the first element of a source dictionary is copied into composite dictionary. An element is copied into a root of elements tree.

See also:

IRdsCompoundDictionaryElements