IDynamicInstance.Clone

Syntax

Clone(op: DynamicInstanceOperationsVisibility; Mark: Variant): IDynamicInstance;

Parameters

op. Parameter determines to which dictionaries executed operation is applied.

Mark. Set to which dictionary will belong.

Description

The Clone method creates dictionary copy.

Example

Executing the example requires a form containing the components:

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:

IDynamicInstance