copy Method

Class: Reference

Description

This method creates a new object (i.e., toObject) that is an exact copy of the original object (i.e., fromObject). A copy of an array is an array that has the same number of elements as the original array. In addition, each element of the array has the same value as the corresponding element in the original array.

You can only copy like objects. You can only copy multi-node records to other records of the same class. That is, you can only copy objects of the RecordACN class to other objects defined for that class. You cannot copy objects of the RecordACN class to objects of the RecordLN class.

Descendant classes may override this method to provide more powerful copy capabilities.

Syntax

toObject=fromObject.copy()

Parameters

None.

 

Returns

A new object of the same type as the original object.

When Became Available

Profile v6.0

Example

// Copy dep1 into dep2

 

type RecordDEP dep1 = Db.getRecord("DEP",CID)

type RecordDEP dep2 = dep1.copy(