IMetabase.CopyObject

Syntax

CopyObject(Info: IMetabaseObjectCopyInfo);

Parameters

Info - information about the object the is being copied.

Description

The CopyObject method copies a repository object according to the information that is passed in the Info parameter.

Comments

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.

Example

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:

IMetabase | IMetabaseObjectCopyInfo