MergeWith(Other: IDynamicInstance): Boolean;
Other. Dictionary with which main dictionary should be merged.
The MergeWith method merges dictionaries.
Executing the example requires a form containing the DimensionTree component named DimensionTree1, the UiDimension component named UiDimension1, and the Button component named Button1. Specify the UiDimension1 component as a data source for the DimensionTree1 component. Data source for the UiDimension1 component must be MDM dictionary with configured dynamic loading of elements.
It is also required that the repository contains an additional MDM dictionary with configured dynamic loading of elements and with the MERGE_DIM identifier.
The example is a handler of the OnClick event for the Button1 component.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
MB: IMetabase;
Dim: IDynamicInstance;
DimForMerge: IDynamicInstance;
Begin
MB := MetabaseClass.Active;
Dim := UiDimension1.DimInstance As IDynamicInstance;
// Open dictionary for merging
DimForMerge := MB.ItemById("MERGE_DIM").Open(Null) As IDynamicInstance;
If Dim.CanMergeWith(DimForMerge) Then
Dim.MergeWith(DimForMerge);
End If;
End Sub Button1OnClick;
On clicking the button data of the MERGE_DIM dictionary will be copied to the dictionary located in the DimensionTree1 component.
See also: