CreateClone function (automation interface)
Syntax:
<object to own clone>.CreateClone(<object to clone>)
Where:
• <object to clone> is an object that specifies the object that is to be cloned.
The CreateClone function clones an object to a specified owner. The function returns the cloned object.
Note that there are two functions that you can use for cloning items:
• CreateClone function - Use this function when you want to be able to undo any changes that are made by the clone operation. If the clone operation is not complete within the time that is set for the Database Transaction Timeout (30 minutes by default), the operation will fail.
CreateCloneEx function - Use this function when the clone operation takes longer than the time that is set for the Database Transaction Timeout (30 minutes by default). You cannot undo any changes that are made by the CreateCloneEx function.
Examples
This example creates a clone of the DDIT class in the STS package. The objClonedObject variable is set to the item that is created by clone operation.
Set objToOwnClone = Dictionary.Item("Package","STS")
Set objToClone = Dictionary.Item("Class","DDIT")
Set objClonedObject = objToOwnClone.CreateClone(objToClone)