CopyObject method

Description

Creates a copy of the specified object in the object repository.

Important Information

To copy an object from one object repository to another, first create a copy of the object using this method. Then load another object repository, and use the AddObject method to add the returned (copied) object to the other repository.

Syntax

object.CopyObject(Object)

Syntax Details

ArgumentDescription
objectAn expression evaluating to an object of type ObjectRepositoryUtil.
ObjectRequired. An Object object.

The object to copy.

You can use the GetObject, GetObjectByParent or Item methods to retrieve the object to use as this argument value.

Return Type

An Object object.  The copy of the object.

Tips:
You can use the returned test object as an argument value for other methods (for example, AddObjectGetLogicalName, and UpdateObject.)

For test objects, you can also use the GetTOProperty and SetTOProperty methods to modify the returned test object properties before updating them in the object repository (using UpdateObject.)