---
schema_version: "1"
id: f6b72c18a15161491a762b50453bfd2f7ad7b9ef2110945ba4d242abc9ac851f
title: Use Custom Fields in B2B Pricing Procedure
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/commerce/264-0-0/comm_pricing_context_extension.md
canonical_url: https://help.salesforce.com/s/articleView?id=commerce.comm_pricing_context_extension.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: a256dfa49bbca2d1eb2bb57d532efdd934ff54412eefe93af844c6f416324ec6
description: 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.
products:
  - Commerce
  - B2B Commerce
release: "264"
---
# 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

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;"><a href="https://help.salesforce.com/s/articleView?id=commerce.comm_editions.htm&amp;language=en_US" target="_blank">View supported editions</a>.</td></tr></tbody></table>

[Which Salesforce Commerce Product Do I Have?](https://help.salesforce.com/s/articleView?id=commerce.comm_what_product.htm&language=en_US)

![Important](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-commerce-comm-264-0-0-production-enus/d863e308-482a-4dfa-8d20-2a94737d394a/images/icon_important.png)

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](https://help.salesforce.com/s/articleView?id=ind.pricing_create_context_definitions.htm&language=en_US).

To include custom fields in a pricing procedure, you must first create those fields. For details, see [Create a Custom Field](https://help.salesforce.com/s/articleView?id=platform.adding_fields.htm&language=en_US).

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 [Configure Advanced Pricing for Commerce in Your B2B Store](https://help.salesforce.com/s/articleView?id=commerce.comm_enable_commerce_pricing_elements_in_your_b2b_or_d2c_store.htm&release=264.0.0&type=5 "Configure Advanced Pricing powered by Revenue Cloud in order to use several Commerce features, including subscriptions and product configurator.").
3. Turn on **Pricing Context Extension Service**.
4. Click ![Setup icon](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-commerce-comm-264-0-0-production-enus/d863e308-482a-4dfa-8d20-2a94737d394a/comm/images/comm_setup_icon_no_border.png)and 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 arrow](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-commerce-comm-264-0-0-production-enus/d863e308-482a-4dfa-8d20-2a94737d394a/comm/images/1cb2c_edit_action_arrow.png)and 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](https://help.salesforce.com/s/articleView?id=ind.context_service_view_edit_saved_context_definitions.htm&language=en_US).
    
    ![Edit context definitions](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-commerce-comm-264-0-0-production-enus/d863e308-482a-4dfa-8d20-2a94737d394a/comm/images/b2b_comm_edit_context_extension.png)
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](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-commerce-comm-264-0-0-production-enus/d863e308-482a-4dfa-8d20-2a94737d394a/comm/images/1cb2c_edit_action_arrow.png) and select **Edit SObject Mapping**.
    
    ![Edit object mappings](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-commerce-comm-264-0-0-production-enus/d863e308-482a-4dfa-8d20-2a94737d394a/comm/images/b2b_comm_edit_object_mapping.png)
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](https://help.salesforce.com/s/articleView?id=ind.context_service_map_context_definitions.htm&language=en_US).
    
    ![Map context definition for Account attribute.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-commerce-comm-264-0-0-production-enus/d863e308-482a-4dfa-8d20-2a94737d394a/comm/images/b2b_comm_map_context_definitions_account.png)
15. Similarly, map the fields in the `SalesTransactionItem` node to the corresponding attribute in the Product object.
    
    ![Map context definition for Product attribute.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-commerce-comm-264-0-0-production-enus/d863e308-482a-4dfa-8d20-2a94737d394a/comm/images/b2b_comm_map_context_definitions_product.png)
16. Save your changes.
17. For `OrderEntitiesMapping`, repeat steps 12–16 to map your custom fields.
18. Similarly, for `QuoteEntitiesMapping`, click ![Action arrow](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-commerce-comm-264-0-0-production-enus/d863e308-482a-4dfa-8d20-2a94737d394a/comm/images/1cb2c_edit_action_arrow.png) 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.

#### See Also

- [Context Definitions](https://help.salesforce.com/s/articleView?id=ind.context_service_context_definitions.htm&language=en_US)
- [Create a Custom Field](https://help.salesforce.com/s/articleView?id=platform.adding_fields.htm&language=en_US)