Loading
Salesforce now sends email only from verified domains. Read More
Salesforce B2B Commerce
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
          Use Custom Fields in B2B Pricing Procedure

          Use Custom Fields in B2B Pricing Procedure

          Customize pricing rules by integrating custom fields into your pricing procedure. Extend the standard Commerce context definition to add your custom Account and Product attributes, such as Loyalty Status or Product Capacity. Map these attributes to the pricing context so they're available for use in your pricing procedure.

          Required Editions

          View supported editions.

          Which Salesforce Commerce Product Do I Have?

          Important
          Important To extend the standard context definitions, you need these licenses:
          • Salesforce Commerce Growth or Advanced
          • Salesforce Revenue Cloud Advanced

          For details about context definitions and their role in pricing procedures, see Context Definitions.

          To include custom fields in a pricing procedure, you must first create those fields. For details, see Create a Custom Field.

          1. From your store, go to Settings | Store and select the Pricing tab.
          2. Turn on Advanced Pricing for Commerce Powered by Revenue Cloud. See Enable Advanced Pricing for Commerce Powered by Revenue Cloud.
          3. Turn on Pricing Context Extension Service.
          4. Click Setup iconand select Setup.
          5. From Setup, in the Quick Find box, find and select Context Definitions.
          6. On the Standard Definitions tab, find CommerceCartContextDefinition and then click Action arrowand select Extend.
          7. Enter a name for the extended context definition and save it. The extension process takes up to a few minutes to complete.
          8. On the Custom Definitions tab, select the extended definition you created. If you don’t see it in the list, refresh the page.
          9. To edit your extended custom definition, click Edit. Add the account fields within the SalesTransaction node. Make sure that Type is set to Input for the newly added fields. For Data Type, select String, Number, Boolean, Date, Date Time, or Percent. For instructions, see Edit Context Definitions.
            Edit context definitions
          10. Similarly, add the product fields within the SalesTransactionItem node.
          11. After you create a context definition, go to the Map Data tab to define where the data is fetched from.
          12. For CommerceCartMapping, click Action arrow and select Edit SObject Mapping.
            Edit object mappings
          13. In the Edit Mapping page, click Map.
          14. Map the fields in the SalesTransaction node to the corresponding attribute in the Account object. For more information on mapping attributes to fields, see Map Context Definitions.
            Map context definition for Account attribute.
          15. Similarly, map the fields in the SalesTransactionItem node to the corresponding attribute in the Product object.
            Map context definition for Product attribute.
          16. Save your changes.
          17. For OrderEntitiesMapping, repeat steps 12–16 to map your custom fields.
          18. Similarly, for QuoteEntitiesMapping, click Action arrow and select Edit Input Mapping. Add an input-mapping for your custom field. For the Field value, enter the same field tag used for the custom field in CommerceCartMapping. Save the mapping.
          19. Activate the context definition.
          20. Update your pricing procedure to define custom pricing logic by using the custom fields.
            1. From the App Launcher, find and select Pricing Procedures.
            2. Select the pricing procedure of your org.
            3. Create a new version of the pricing procedure.
            4. For Context Definition, select the extended context definition from the previous steps.
            5. Save your changes and activate the pricing procedure. Now, you can modify your pricing procedure by using the newly created custom attributes.
           
          Loading
          Salesforce Help | Article