Assign(Value: IMetabaseObject);
Value. Repository object from that data are taken.
The Assign method copies data from a source sent by the Value parameter.
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:
All internal models are copied.
Links to copied internal models are reconfigured.
Links of copied internal models are reconfigured to a copied metamodel.
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: