cloneRecord()
Overview
public string function cloneRecord(
required string objectName
, required string recordId
, required struct data
, string newRecordId = ""
, boolean isDraft = false
, numeric versionNumber
, array bypassTenants
)
Clones a record for the given object, record ID and supporting data
Arguments
Name | Type | Required | Description |
---|---|---|---|
objectName | string | Yes | Name of the object whose record you wish to clone |
recordId | string | Yes | ID of the record to clone |
data | struct | Yes | Data to overwrite any data for the existing record |
newRecordId | string | No (default="") | Used to specify an ID to use for the new record |
isDraft | boolean | No (default=false) | Whether or not the clone is to be a draft record |
versionNumber | numeric | No | Specific version number to use when versioning the new record |
bypassTenants | array | No | Array of tenants to ignore when cloning (i.e. when cloning into an alternative tenant to the currently active one) |