Loading
Feature degradation | Gmail Email delivery failureRead 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
          Optimized Performance with Targeted Cloning (Managed Package)

          Optimized Performance with Targeted Cloning (Managed Package)

          To maximize performance, clone only the specific object nodes that you want to modify. This approach creates an object where only the specified node is modifiable, and the other nodes of the object remain in their original read-only state.

          REQUIRED EDITIONS
          Available in: Lightning Experience
          Available in: Enterprise, Developer, and Unlimited Editions

          Cloning Specific Nodes

          Managed Package Icon This feature is part of the Communications Cloud managed package.

          This process makes sure that you make modifiable copies of only the specific nodes that you want to modify.

          Example
          Example

          This example uses the map() iterator to create modifiable copies of only the necessary attribute nodes.

          let newModifiableNode = childLineItem.originalNonModifiableAttributeNode?.map(originalNonModifiableAttribute => {
              let attr = enhancedDeepClone(originalNonModifiableAttribute); // This copy is modifiable
              attr.binded = childLineItem.action === 'Add' && this.bindedAttributes[childLineItem.PricebookEntry.Product2.ProductCode] !== undefined && this.bindedAttributes[childLineItem.PricebookEntry.Product2.ProductCode].includes(attr.code);
              return attr;
              });

          Reinsert the new modifiable node into the original object after cloning.

          childLineItem = {...childLineItem, originalNonModifiableAttributeNode: newModifiableNode};
           
          Loading
          Salesforce Help | Article