Clone(op: DynamicInstanceOperationsVisibility; Mark: Variant): IDynamicInstance;
op. Parameter determines to which dictionaries executed operation is applied.
Mark. Set to which dictionary will belong.
The Clone method creates dictionary copy.
Executing the example requires a form containing the components:
DimensionTree with the DimensionTree1 identifier.
DimensionTree with the DimensionTree2 identifier.
UiDimension with the UiDimension1 identifier.
UiDimension with the UiDimension2 identifier.
Button with the Button1 identifier.
Specify the UiDimension1 component as data source for the DimensionTree1 component and the UiDimension2 component as data source for the DimensionTree2 component. Data source for the UiDimension1 component must be MDM table dictionary with set dynamic loading of elements.
The example is a handler of the OnClick event for the Button1 component.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Dim: IDynamicInstance;
DimCopy: IDynamicInstance;
Begin
Dim := UiDimension1.DimInstance As IDynamicInstance;
// Create dictionary copy
If Dim.CanClone(DynamicInstanceOperationsVisibility.Local, "Copy") Then
DimCopy := Dim.Clone(DynamicInstanceOperationsVisibility.Local, "Copy");
UiDimension2.Dimension := DimCopy.DimensionModel;
End If;
End Sub Button1OnClick;
On clicking the Button1 button dictionary copy will be created. The copy will be displayed in the DimensionTree2 component.
See also: