---
schema_version: "1"
id: 67e85e2f96958958a5be9f79282fdcfeb47aaac802baf2fcb65e39efe7e24536
title: Clone Record Invocable Action
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ind/264-0-0/comms_clone_record_invocable_action.md
canonical_url: https://help.salesforce.com/s/articleView?id=ind.comms_clone_record_invocable_action.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: ffef0532fdcf23679ad9c6b401813b0c1f764f91bb3b9f7ec7f318c5925ab8b9
description: Use this action to clone a record and its related objects based on configuration. For example, you can instantly duplicate complex project templates including all predefined milestones and task dependencies.
products:
  - Communications
release: "264"
---
# Clone Record Invocable Action

Use this action to clone a record and its related objects based on configuration. For example, you can instantly duplicate complex project templates including all predefined milestones and task dependencies.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col style="width:100%"></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Enterprise</strong>, <strong>Unlimited</strong>, and <strong>Developer</strong> Editions</td></tr></tbody></table>

## Input Values

  
| Parameter | Description | Data Type |
| --- | --- | --- |
| recordId | The ID of the record to clone. | String |
| objectApiName | The API name of the object to clone, such as Quote or Order. | String |
| objectDetailsInSortedOrder | A JSON string containing the configuration of objects to clone in sorted order. | String |
| executionMode | The mode of execution, either sync (synchronous) or async (asynchronous). The default is async. | String |
| targetRecordId | The ID of the existing record to use. If provided, the action uses this record instead of creating a new one. | String |
| targetRecordTypeApiName | The API name of the record type to set on the cloned record. | String |
| targetFieldUpdates | A JSON string containing field API names and values to update on the cloned record. For example: {"Name":"New Name","Status":"Draft"}. | String |
| runPricing | A Boolean value that indicates whether to run pricing after cloning. | String |
| runValidation | A Boolean value that indicates whether to run validation after cloning. | Boolean |

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-communications-264-0-0-production-enus/444efb86-ea1e-477e-afbc-56eaac192eaf/images/icon_note.png)

Note If the source quote or order's status is Activated, Salesforce won't let the cloned record save with that status. Include a Draft value in targetFieldUpdates (for example, {"Status": "Draft"}) for the clone to succeed.

## Output Values

  
| Parameter | Description | Data Type |
| --- | --- | --- |
| isSuccess | A Boolean value that indicates whether the clone operation was successful. | String |
| outputMessage | A message containing the details of the output. | String |
| clonedRecordId | The ID of the cloned record. | String |
| clonedRecordName | The name of the cloned record. | String |
| clonedRecordStatus | The status of the cloned record. | String |
| asyncJobId | The batch job ID if the execution mode is asynchronous. | String |
| errorMessage | An error message if the operation failed. | String |

## Example

JSON Request

```json

{
  "recordId": "8013A000001XyZQAA0",
  "executionMode": "sync",
  "runPricing": false,
  "runValidation": false,
  "targetRecordId": null,
  "targetRecordTypeDevName": null,
  "targetFieldUpdatesJson": "{"Name": "Cloned Order - Copy", "Status": "Draft"}",
  "objectDetailsInSortedOrderJson": "[
    {
      "className": "B2BCmexCloneImpl",
      "dependentFields": [],
      "filterFieldName": "Id",
      "filterOnObject": "Order",
      "objectName": "Order"
    },
    {
      "className": "B2BCmexCloneImpl",
      "dependentFields": ["vlocity_cmt__OrderId__c"],
      "filterFieldName": "vlocity_cmt__OrderId__c",
      "filterOnObject": "Order",
      "objectName": "vlocity_cmt__OrderGroup__c"
    },
    {
      "className": "B2BCmexCloneImpl",
      "dependentFields": ["vlocity_cmt__OrderId__c", "vlocity_cmt__OrderGroupId__c"],
      "filterFieldName": "vlocity_cmt__OrderId__c",
      "filterOnObject": "Order",
      "objectName": "vlocity_cmt__OrderMember__c"
    },
    {
      "className": "B2BCmexOrderItemCloneImpl",
      "dependentFields": ["OrderId", "vlocity_cmt__OrderGroupId__c", "vlocity_cmt__OrderMemberId__c"],
      "filterFieldName": "OrderId",
      "filterOnObject": "Order",
      "objectName": "OrderItem",
      "orderBy": "vlocity_cmt__LineNumber__c"
    },
    {
      "className": "B2BCmexCloneImpl",
      "dependentFields": ["vlocity_cmt__OrderId__c"],
      "filterFieldName": "vlocity_cmt__OrderId__c",
      "filterOnObject": "Order",
      "objectName": "vlocity_cmt__OrderDiscount__c"
    }
  ]"
}
```

JSON Response Body

```json

{
  "success": true,
  "message": "Record cloned successfully",
  "clonedRecordId": "8013A000002AbCDAA0",
  "clonedRecordName": "Cloned Order - Copy",
  "asyncJobId": null,
  "error": null
}
```

JSON Response Body for Async Mode

```json
{
  "success": true,
  "message": "Record cloned successfully",
  "clonedRecordId": "8013A000002AbCDAA0",
  "clonedRecordName": null,
  "clonedRecordStatus": null,
  "asyncJobId": "707XX0000004CuZQAU",
  "error": null
}
```