IMetabaseObject.Assign

Syntax

Assign(Value: IMetabaseObject);

Parameters

Value. Repository object from that data are taken.

Description

The Assign method copies data from a source sent by the Value parameter.

Comments

This method cannot be used to copy objects that have embedded objects. One can determine presence of nested objects by getting value of the IMetabaseObjectDescriptor.Children property. Nested objects that cannot be copied are: facts of standard and virtual cubes, tasks and scenario dictionary, express views of cubes.

When copying a metamodel that contains internal models:

Example

Executing the example requires that the repository contains a unit with the Module_1 identifier.

Add a link to the Metabase system assembly.


Sub UserProc;
Var
    MB: IMetabase;
    MObj: IMetabaseObject;
    CrInfo: IMetabaseObjectCreateInfo;
Begin
    MB := MetabaseClass.Active;
    CrInfo := MB.CreateCreateInfo;
    CrInfo.ClassID := MetabaseObjectClass.KE_CLASS_MODULE;
    CrInfo.Id := MB.GenerateId("New_Module");
    CrInfo.Name := "New unit";
    CrInfo.Parent := MB.Root;
    MObj := MB.CreateObject(CrInfo).Edit;
    MObj.Assign(MB.ItemById("Module_1").Bind);
    MObj.Save;
End Sub UserProc;

After executing the example a new unit is created in the repository root. The unit listing is copied from the Module_1 unit.

See also:

IMetabaseObject