---
schema_version: "1"
id: da63ac9caa41e2b203732866497cd65b8b62c578bb9bf2c0c7166af3ab739039
title: Set Up Deep Clone API Configuration
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ind/264-0-0/comms_configure_enterprise_quote_clone_api.md
canonical_url: https://help.salesforce.com/s/articleView?id=ind.comms_configure_enterprise_quote_clone_api.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 75ccf5fcc4bec4e053659ff8b174aac570fb312452b61c9b90fd3afa1bf1fb76
description: Configure and implement the fully invocable Clone API to support programmatic automation for enterprise quotes and enterprise orders.
products:
  - Communications
release: "264"
---
# Set Up Deep Clone API Configuration

Configure and implement the fully invocable Clone API to support programmatic automation for enterprise quotes and enterprise orders.

![Managed Package Icon](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-communications-264-0-0-production-enus/444efb86-ea1e-477e-afbc-56eaac192eaf/communications/images/media_package_icon.png) _This feature is part of the Communications Cloud managed package._

| REQUIRED EDITIONS |
| --- |
| Available in: Lightning Experience |
| Available in: **Enterprise**, **Performance**, **Unlimited**, and **Developer** Editions |

1. As an admin, define the configuration parameters:
    
    - Additional related objects: Specify custom objects, by their API name, that you want to clone along with the quote.
    - Relationship traversal: Define which specific parent-child relationships the API should follow.
    - Line item grouping**:** Configure fields, such as Quote Member or Quote Group, to group Quote Line Items for optimized batch processing.
    
    ![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 API rolls back on system errors but not on validation failures. Validation rules execute only on the target quote.
2. Control how root object field values are handled during the clone.
    
    Use targetFieldUpdates to update field values on the root object in the cloned record and handle Salesforce restrictions on certain field values when cloning a record.
    
    For example, Salesforce prevents cloning an Order with its status as Activated. Provide a Draft status value in targetFieldUpdates for a successful clone.
    
    ![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 targetFieldUpdates applies only when cloning to a new record. If you specify a targetRecordId, Salesforce restrictions still apply.
3. Review the following JSON examples for cloning objects and inheriting their related entities:
    
    **Example 1: Sample payload for cloning a standard CPQ order**
    
    Record type ID for Standard Order is '012Hn000000H7OqIAK'
    
    ```json
    {
      "recordId": "0Q0LT000000K1Hh0AK",
      "sObjectName": "Order",
      "executionMode": "sync",
      "targetRecordId": "",
      "targetFieldUpdates": {
        "Name": "Cloned Standard Order",
        "Description": "Order cloned with status update",
        "Status": "Draft"
      },
      "runPricing": true,
      "runValidation": true,
      "defaultObjectsToClone": [
        {
          "name": "Order"
        },
        {
          "name": "OrderProduct"
        }
      ],
      "cloningOptions": [
        {
          "customLabelName": "CMEXOrderCloneMemberAndGroup",
          "isSelected": true,
          "objectsToClone": [
            {
              "name": "vlocity_cmt__OrderGroup__c"
            }
          ]
        },
        {
          "customLabelName": "CMEXOrderCloneProductRelationship",
          "isSelected": true,
          "objectsToClone": [
            {
              "name": "vlocity_cmt__OrderItemRelationship__c"
            }
          ]
        },
        {
          "customLabelName": "CMEXOrderClonePricing",
          "isSelected": true,
          "objectsToClone": [
            {
              "name": "vlocity_cmt__OrderAppliedPromotion__c"
            },
            {
              "name": "vlocity_cmt__OrderPriceAdjustment__c"
            },
            {
              "name": "vlocity_cmt__OrderItemPriceAdjustment__c"
            },
            {
              "name": "vlocity_cmt__OrderAppliedPromotionItem__c"
            }
          ]
        }
      ],
      "objectDetailsInSortedOrder": [
        {
          "objectName": "Order",
          "className": "B2BCmexCloneImpl",
          "filterFieldName": "Id",
          "filterOnObject": "Order",
          "dependentFields": [
            "Name"
          ]
        },
        {
          "objectName": "vlocity_cmt__OrderGroup__c",
          "className": "B2BCmexCloneImpl",
          "filterFieldName": "vlocity_cmt__OrderId__c",
          "filterOnObject": "Order",
          "dependentFields": [
            "vlocity_cmt__OrderId__c"
          ]
        },
        {
          "objectName": "OrderItem",
          "className": "B2BCmexQuoteLineItemCloneImpl",
          "filterFieldName": "OrderId",
          "filterOnObject": "Order",
          "dependentFields": [
            "OrderId",
            "vlocity_cmt__OrderGroupId__c"
          ],
          "orderBy": "vlocity_cmt__LineNumber__c"
        },
        {
          "objectName": "vlocity_cmt__OrderItemRelationship__c",
          "className": "B2BCmexCloneImpl",
          "filterFieldName": "vlocity_cmt__OrderId__c",
          "filterOnObject": "Order",
          "dependentFields": [
            "vlocity_cmt__OrderId__c",
            "vlocity_cmt__OrderItemId__c",
            "vlocity_cmt__RelatedOrderItemId__c",
            "vlocity_cmt__RelatedAssetReferenceId__c"
          ]
        },
        {
          "objectName": "vlocity_cmt__OrderAppliedPromotion__c",
          "className": "B2BCmexCloneImpl",
          "filterFieldName": "vlocity_cmt__OrderId__c",
          "filterOnObject": "Order",
          "dependentFields": [
            "vlocity_cmt__OrderId__c",
            "vlocity_cmt__OrderItemId__c"
          ]
        },
        {
          "objectName": "vlocity_cmt__OrderPriceAdjustment__c",
          "className": "B2BCmexOrderPriceAdjustmentCloneImpl",
          "filterFieldName": "vlocity_cmt__OrderId__c",
          "filterOnObject": "Order",
          "dependentFields": [
            "vlocity_cmt__OrderId__c",
            "vlocity_cmt__OrderItemId__c",
            "vlocity_cmt__OrderAppliedPromotionId__c"
          ]
        },
        {
          "objectName": "vlocity_cmt__OrderAppliedPromotionItem__c",
          "className": "B2BCmexCloneImpl",
          "filterFieldName": "vlocity_cmt__OrderAppliedPromotionId__c",
          "filterOnObject": "vlocity_cmt__OrderAppliedPromotion__c",
          "dependentFields": [
            "vlocity_cmt__OrderAppliedPromotionId__c",
            "vlocity_cmt__OrderItemId__c"
          ]
        }
      ]
    }
    ```
    
    **Example 2: Sample payload for cloning a standard CPQ quote**
    
    Record Type ID for Standard Quote is '012Hn000000H7OsIAK'
    
    ```json
    {
      "recordId": "0Q0LT000000K1Hh0AK",
      "sObjectName": "Quote",
      "executionMode": "sync",
      "targetRecordId": "",
      "targetFieldUpdates": {
        "Name": "TQ Clone ASB"
      },
      "runPricing": true,
      "runValidation": true,
      "defaultObjectsToClone": [
        {
          "name": "Quote"
        },
        {
          "name": "QuoteLineItem"
        }
      ],
      "cloningOptions": [
        {
          "customLabelName": "CMEXQuoteCloneMemberAndGroup",
          "isSelected": true,
          "objectsToClone": [
            {
              "name": "vlocity_cmt__QuoteGroup__c"
            }
          ]
        },
        {
          "customLabelName": "CMEXQuoteCloneProductRelationship",
          "isSelected": true,
          "objectsToClone": [
            {
              "name": "vlocity_cmt__QuoteLineItemRelationship__c"
            }
          ]
        },
        {
          "customLabelName": "CMEXQuoteClonePricing",
          "isSelected": true,
          "objectsToClone": [
            {
              "name": "vlocity_cmt__QuoteAppliedPromotion__c"
            },
            {
              "name": "vlocity_cmt__QuotePricingAdjustment__c"
            },
            {
              "name": "vlocity_cmt__QuoteLineItemPricingAdjustment__c"
            },
            {
              "name": "vlocity_cmt__QuoteAppliedPromotionItem__c"
            }
          ]
        }
      ],
      "objectDetailsInSortedOrder": [
        {
          "objectName": "Quote",
          "className": "B2BCmexCloneImpl",
          "filterFieldName": "Id",
          "filterOnObject": "Quote",
          "dependentFields": []
        },
        {
          "objectName": "vlocity_cmt__QuoteGroup__c",
          "className": "B2BCmexCloneImpl",
          "filterFieldName": "vlocity_cmt__QuoteId__c",
          "filterOnObject": "Quote",
          "dependentFields": [
            "vlocity_cmt__QuoteId__c"
          ]
        },
        {
          "objectName": "QuoteLineItem",
          "className": "B2BCmexQuoteLineItemCloneImpl",
          "filterFieldName": "QuoteId",
          "filterOnObject": "Quote",
          "dependentFields": [
            "QuoteId",
            "vlocity_cmt__QuoteGroupId__c"
          ],
          "orderBy": "vlocity_cmt__LineNumber__c"
        },
        {
          "objectName": "vlocity_cmt__QuoteLineItemRelationship__c",
          "className": "B2BCmexCloneImpl",
          "filterFieldName": "vlocity_cmt__QuoteId__c",
          "filterOnObject": "Quote",
          "dependentFields": [
            "vlocity_cmt__QuoteId__c",
            "vlocity_cmt__QuoteLineItemId__c",
            "vlocity_cmt__RelatedQuoteLineItemId__c",
            "vlocity_cmt__RelatedAssetReferenceId__c"
          ]
        },
        {
          "objectName": "vlocity_cmt__QuoteAppliedPromotion__c",
          "className": "B2BCmexCloneImpl",
          "filterFieldName": "vlocity_cmt__QuoteId__c",
          "filterOnObject": "Quote",
          "dependentFields": [
            "vlocity_cmt__QuoteId__c",
            "vlocity_cmt__QuoteLineItemId__c"
          ]
        },
        {
          "objectName": "vlocity_cmt__QuotePricingAdjustment__c",
          "className": "B2BCmexCloneImpl",
          "filterFieldName": "vlocity_cmt__QuoteId__c",
          "filterOnObject": "Quote",
          "dependentFields": [
            "vlocity_cmt__QuoteId__c",
            "vlocity_cmt__QuoteItemId__c",
            "vlocity_cmt__QuoteAppliedPromotionId__c"
          ]
        },
        {
          "objectName": "vlocity_cmt__QuoteAppliedPromotionItem__c",
          "className": "B2BCmexCloneImpl",
          "filterFieldName": "vlocity_cmt__QuoteAppliedPromotionId__c",
          "filterOnObject": "vlocity_cmt__QuoteAppliedPromotion__c",
          "dependentFields": [
            "vlocity_cmt__QuoteAppliedPromotionId__c",
            "vlocity_cmt__QuoteLineItemId__c"
          ]
        }
      ]
    }
    ```
    
    **Example 3: Sample payload for cloning a Energy & Utilities quote**
    
    Record type ID for Master Quote is 012Hn000000H7OtIAK.
    
    ```json
    {
      "recordId": "0Q0LT000000K1Hh0AK",
      "sObjectName": "Quote",
      "executionMode": "sync",
      "targetRecordId": "",
      "targetFieldUpdates": {
        "Name": "TQ Clone ASB Cloned Without WorkingCart"
      },
      "runPricing": true,
      "runValidation": true,
      "groupLineItemsBy": [
        "QuoteId",
        "QuoteMemberId"
      ],
      "objectDetailsInSortedOrder": [
        {
          "objectName": "Quote",
          "dependentFields": [],
          "className": "B2BCmexCloneImpl"
        },
        {
          "objectName": "vlocity_cmt__QuoteGroup__c",
          "className": "B2BCmexCloneImpl",
          "filterFieldName": "vlocity_cmt__QuoteId__c",
          "filterOnObject": "Quote",
          "dependentFields": [
            "vlocity_cmt__QuoteId__c"
          ]
        },
        {
          "objectName": "Quote",
          "dependentFields": ["vlocity_cmt__QuoteGroupId__c"],
          "className": "B2BCmexCloneImpl",
          "filterFieldName": "vlocity_cmt__ParentQuoteId__c",
          "filterOnObject": "Quote",
          "hierarchyConfig": {
            "sourceFieldName": "Id",
            "createNewGUID": false,
            "linkFields": [
              "vlocity_cmt__ParentQuoteId__c"
            ]
          }
        },
        {
          "objectName": "vlocity_cmt__QuoteMember__c",
          "className": "B2BCmexCloneImpl",
          "filterFieldName": "vlocity_cmt__QuoteId__c",
          "filterOnObject": "Quote",
          "dependentFields": [
            "vlocity_cmt__QuoteId__c",
            "vlocity_cmt__QuoteGroupId__c"
          ]
        },
        {
          "objectName": "QuoteLineItem",
          "className": "B2BCmexQuoteLineItemCloneImpl",
          "filterFieldName": "QuoteId",
          "filterOnObject": "Quote",
          "dependentFields": [
            "QuoteId",
            "vlocity_cmt__QuoteGroupId__c",
            "vlocity_cmt__QuoteMemberId__c"
          ],
          "orderBy": "vlocity_cmt__LineNumber__c"
        },
        {
          "objectName": "vlocity_cmt__QuoteLineItemRelationship__c",
          "className": "B2BCmexCloneImpl",
          "filterFieldName": "vlocity_cmt__QuoteId__c",
          "filterOnObject": "Quote",
          "dependentFields": [
            "vlocity_cmt__QuoteId__c",
            "vlocity_cmt__QuoteLineItemId__c",
            "vlocity_cmt__RelatedQuoteLineItemId__c",
            "vlocity_cmt__RelatedAssetReferenceId__c"
          ]
        },
        {
          "objectName": "vlocity_cmt__QuoteAppliedPromotion__c",
          "className": "B2BCmexCloneImpl",
          "filterFieldName": "vlocity_cmt__QuoteId__c",
          "filterOnObject": "Quote",
          "dependentFields": [
            "vlocity_cmt__QuoteId__c",
            "vlocity_cmt__QuoteDiscountId__c",
            "vlocity_cmt__QuoteLineItemId__c"
          ]
        },
        {
          "objectName": "vlocity_cmt__QuotePricingAdjustment__c",
          "className": "B2BCmexQuotePricingAdjustmentCloneImpl",
          "filterFieldName": "vlocity_cmt__QuoteId__c",
          "filterOnObject": "Quote",
          "dependentFields": [
            "vlocity_cmt__QuoteId__c",
            "vlocity_cmt__QuoteItemId__c",
            "vlocity_cmt__QuoteAppliedPromotionId__c"
          ]
        },
        {
          "objectName": "vlocity_cmt__QuoteAppliedPromotionItem__c",
          "className": "B2BCmexCloneImpl",
          "filterFieldName": "vlocity_cmt__QuoteAppliedPromotionId__c",
          "filterOnObject": "vlocity_cmt__QuoteAppliedPromotion__c",
          "dependentFields": [
            "vlocity_cmt__QuoteAppliedPromotionId__c",
            "vlocity_cmt__QuoteLineItemId__c"
          ]
        }
      ]
    }
    ```
4. Understand the objectDetailsInSortedOrder field descriptions:
    
     
    | Field | Description |
    | --- | --- |
    | className | Apex class implementing B2BCmexBaseCloneInterface, typically "B2BCmexCloneImpl" |
    | dependentFields | List of lookup fields that need to be updated with new cloned IDs (e.g., \["QuoteId", "QuoteGroupId\_\_c"\]) |
    | filterFieldName | Field name used to query records to clone (e.g., "Id", "QuoteId", "ParentQuoteId\_\_c") |
    | filterOnObject | Which previously cloned object's IDs to use as filter values (references an earlier objectName in the array) |
    | hierarchyConfig | Configuration for self-referencing relationships (parent-child within same object) |
    | hierarchyConfig.createNewGUID | If true, generates new GUID; if false, uses cloned record's new ID |
    | hierarchyConfig.linkFields | Self-referencing fields to update with new sourceFieldName value (e.g., \["ParentQuoteId\_\_c"\]) |
    | hierarchyConfig.sourceFieldName | Field containing the unique identifier for linking, usually "Id" or a custom reference field |
    | objectName | API name of the SObject to clone (e.g., "Quote", "QuoteLineItem") |
    | orderBy | SQL ORDER BY clause to control cloning sequence (e.g., "LineNumber\_\_c ASC") |
5. Verify the conditions after the API call.
    
    1. Ensure the parent-child quote relationships are correct.
    2. Confirm that all PriceAdjustment\_c records, manual overrides, negotiated discounts, and promotions are preserved.
    
    If any conditions fail, review the API response logs for error details.

The Deep Clone API is configured and ready to clone quotes and orders based on your specified parameters.

- **[Update Root Object Field Values When Cloning](https://help.salesforce.com/s/articleView?id=ind.comms_update_root_object_field_values_when_cloning.htm&release=264.0.0&type=5)**  
    Use targetFieldUpdates to update field values on the root object in the cloned record and handle Salesforce restrictions on certain field values when cloning a record.