Loading
Scheduled maintenance for Salesforce HelpRead More
Intermittent Errors with Salesforce Trial Org Registration Read 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
          Options for the Abstraction Framework (Managed Package)

          Options for the Abstraction Framework (Managed Package)

          The abstraction framework provides options that allow you to make changes in an order at a grandular and well defined level. For complex or deep product model hierachies, you can constrain the query to specific levels of the product model. For orders where a product can occur in multiple line items, you can specify a context ID to ensure that changes are made to the appropriate line item only.

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

          The abstraction framework also allows you to turn on or off pricing and validation.

          Pinpoint a Target in an Order Using ContextID and Mode

          Consider a scenario where you want to remove a product from an order, but the product occurs multiple times in the order and you want to remove one specific instance of that product. In this case, specify Run Option 4 to disconnect the product and also provide the record ID of the product that you want to remove as the ContextId in the input JSON.

          {
          	"OrderId": "8016g000000d1HtAAI",
          	"RunOption": 4,
          	"ContextId": "8026g000000F5J6"
              .
              .
              .
          }

          Now, consider a similar scenario where you want to update the attributes of a child product, where the product occurs multiple times in the order and you want to update one specific instance of the product. In this case, use Run Option 3 to set attributes on the child product and use the ContextId option to specify the record ID of the parent product whose child you want to update. Additionally, use the mode option to specify that only the direct child of the given ContextId should be updated.

          {
          	"OrderId": "8016g000000d1HtAAI",
          	"RunOption": 3,
          	"Mode": "directChild",
          	"ContextId": "8026g000000F5J6"
              .
              .
              .
          }

          Limit the Product Model Search Using Depth

          If your product model extends to many levels of hierarchy, then searching through the entire custom metadata table for each action could have an adverse impact on performance. In such cases, you can opt to restrict the search to "n" levels below the root product by specifying the depth option.

          By default, the depth is set to -1, which indicates that searching is not constrained. All levels of the product model hiearachy are searched for a match. You can specify a numerical value of 2 or greater, to constrain the search accordingly. For example, if you specify the depth as 3, the search will be limited to three levels below Root in the product hieararchy.

          Turn Pricing On or Off

          The abstraction framework provides a method to run pricing for a specified line item or for all the items in the order. While you can invoke the pricing method directly, none of the provided run options invoke pricing. However, you can turn pricing on or off by specifying the appropriate option in the input JSON. You can specify Boolean values for pricing while setting attributes, adding a product, or disconnecting a product by using:

          • priceSetAttribute

          • priceAddProduct

          • priceDisconnectProduct

          For example, to run pricing while adding a product:

          {
          	"OrderId": "8016g000000hNxpAAE",
          	"RunOption": "5",
          	"priceAddProduct": true
              .
              .
              .
          }

          You can also specify pricing as an operation, which allows you to specify the record ID of the order item that you want to run pricing for. If no order item ID is provided, pricing runs for all the items in the cart.

          {
          	"OrderId": "8016g000000hNxpAAE",
          	"RunOption": "5",
          	"Operation": "Pricing",
          	"PricingData": [{
          		"cartId": "8016g000000hNxpAAE",
          		"id": "8026g000000ahUfAAI"
          	}]
              .
              .
              .
          }

          You can also invoke pricing as an operation independent of any action performed using run options. This is useful when there are many actions to be done on a complex product model and running pricing at the same time could hit the Salesforce governor limits.

          Validate the Order

          You can use the validate options provided by the abstraction framework to validate the items in the cart. Specify Boolean values for validation while setting attributes, adding a product, or disconnecting a product by using:

          • validateSetAttributes

          • validateAddProduct

          • validateDisconnectProduct

           
          Loading
          Salesforce Help | Article