CopyObject(Info: IMetabaseObjectCopyInfo);
Info - information about the object the is being copied.
The CopyObject method copies a repository object according to the information that is passed in the Info parameter.
The object that is copied is specified in the Source property, and the folder, into which it is copied, is specified in the Destination property of the Info parameter.
Other properties of the Info parameter are not mandatory. If the name and the identifier are not specified, they are generated automatically.
Executing the example requires an object with the OBJTEST identifier.
Sub Main;
Var
MB: IMetabase;
CInfo: IMetabaseObjectCopyInfo;
Begin
MB := MetabaseClass.Active;
CInfo := MB.CreateCopyInfo;
CInfo.Id := "OBJTEST_Copy";
CInfo.Name := "Copy of the OBJTEST object";
CInfo.WithData := True;
CInfo.Destination := MB.Root;
CInfo.Source := MB.ItemById("OBJTEST");
MB.CopyObject(CInfo);
End Sub Main;
After executing this example the object with the OBJTEST identifier is copied in a repository root. A new object will be named as Copy Of The Object OBJTEST, identifier OBJTEST_Copy and will save data of a copied object.
See also: