The following are the three types of cloning:

  • AllFields
    • All fields from the source object are cloned except the fields specified in ExcludeFields.
    • Fields specified in the IncludeFields are cloned as per the specification. All other fields are cloned by matching the field name from the source and target object.
    • Any calculated fields, Rollup fields and Auto popup fields such as "id", "createdby", "createddate", "modifiedby", "modifieddate", "externalid" are omitted.
  • CustomFields
    • All custom fields from the source object are cloned except the fields specified in ExcludeFields.
    • Fields specified in the IncludeFields are cloned as per the specification irrespective of whether those fields are custom or not.
    • Any calculated fields, Rollup fields, and Auto popup fields such as "id", "createdby", "createddate", "modifiedby", "modifieddate", and "externalid" are omitted
    • Any fields from the source object other than the above fields are omitted.
  • IncludeFields
    • Only the fields specified in the IncludeFields list are cloned.
    • All other fields are omitted.

      Format

      Example

      Description

      “{TargetFieldName}” : “$${SourceFieldName}”“Name” : “$$Name“

      Value of the field “Name” from the source object will be copied into the field “Name” of the target object.

      “{TargetFieldName}” : “$${SourceFieldName}”“Name“ : “$$Description“Value of the “Description” field from the source object is copied into the “Name” field of the target object.
      {TargetFieldName}” : “Static value”“Status” : “Request“Static value “Request“ is copied into the “Status” field of the target object.
      “{TargetFieldName}” : “$${SourceFieldName} + Static value”“Name“ : “$$Name + Clone“Static value “Clone“ is appended to the value of the “Name” field from the source object and then the result will be copied into the “Name” field of the target object.
      “{TargetFieldName}” : “Static value + $${SourceFieldName}”“Name“ : “Copy of - $$Name“

      Static value “Copy of“ will be prepended to the value of the field “Name” from the source object and then the result is copied into the “Name” field of the target object.

      “{TargetFieldName}” : “$$${ContextFieldName}”“ExecutedDate“ : “$$$CURRENT_DATE“Current date is copied into the ExecutedDate field of the target object.
      “{TargetFieldName}” : “$$${ContextFieldName} + {Number}"“ExecutedDate“ : “$$$CURRENT_DATE + 1“One day is added to the current date and the result is copied into the ExecutedDate field of the target object. This arithmetic operation works only if the context field type is either number or date.
      “{TargetFieldName}” : “$$${ContextFieldName} - {Number}”“ExecutedDate“ : “$$$CURRENT_DATE - 3“Three days are deducted from the current date and the result is copied into the ExecutedDate field of the target object. This arithmetic operation works only if the context field type is either number or date.

      Context Fields

      The clone specification feature supports the below list of context fields

      Format

      Example

      CURRENT_DATE

      Current date and time as 00:00:00

      CURRENT_DATE_TIME

      Current date and current time

      CURRENT_MONTH

      Current month number

      CURRENT_MONTH_STARTDATE

      Starting date of current month

      CURRENT_MONTH_ENDDATE

      End date of current month

      CURRENT_YEAR

      Current year number

      CURRENT_ORG

      ID of current context organization

      CURRENT_USER

      LookupObject of current context user

Source and target object names, field names and context field names are case sensitive.