cloneOneToManyRecords()

Overview

public any function cloneOneToManyRecords(
      required string  objectName  
    , required string  recordId    
    , required string  newRecordId 
    , required string  propertyName
    ,          boolean isDraft      = false
)

Clones related one-to-many records for a given source record + new cloned record ID

Arguments

NameTypeRequiredDescription
objectNamestringYesName of the object whose source record is being cloned
recordIdstringYesID of the source record that is being cloned
newRecordIdstringYesID of the newly cloned record
propertyNamestringYesProperty that defines the one-to-many relationship whose records we will also clone
isDraftbooleanNo (default=false)Whether or not the clone is a draft record