Loading
Salesforce Enforces New Security Requirements in Summer 2026Read More
Communications Cloud
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Set Up Deep Clone API Configuration

          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 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
            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
            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'

            {
              "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'

            {
              "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.

            {
              "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.

           
          Loading
          Salesforce Help | Article