IRdsDictionaryInstance.AssignElements

Syntax

AssignElements(Dimension: IDimInstance);

Parameters

Dimension. Data of source dictionary that will be added to the current MDM dictionary.

Description

The AssignElements method fills a tree of elements of MDM dictionary with data from the specified repository dictionary.

Comments

When filling, observe uniqueness and data type of element keys. If an element, which key matches with the key of one of MDM dictionary elements, is inserted, an exception is thrown. New values will be created for inserted elements for the Order attribute.

Example

Executing the example requires that the repository contains an MDM dictionary with the DEST_DICT identifier. The repository also contains a dictionary with any type with the SOURCE_DICT identifier.

Sub UserProc;
Var
    MB: IMetabase;
    DictInst: IRdsDictionaryInstance;
    DimInst: IDimInstance;
Begin
    MB := MetabaseClass.Active;
    // Open MDM dictionary, to which elements from other dictionary will be loaded
    DictInst := MB.ItemById("DEST_DICT").Open(NullAs IRdsDictionaryInstance;
    // Open the dictionary, from which elements will be loaded
    DimInst := MB.ItemById("SOURCE_DICT").Open(NullAs IDimInstance;
    // Load element from dictionary to MDM dictionary
    DictInst.AssignElements(DimInst);
End Sub UserProc;

After executing the example, elements of the SOURCE_DICT dictionary are added to a tree of elements of the MDM dictionary.

See also:

IRdsDictionaryInstance