---
schema_version: "1"
id: f85c4c5706efb16d94a95631e119fcded5ffe5721d162ed25789416f9d48140f
title: Create a Custom Key Attribute
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ind/264-0-0/cg_task_admin_create_custom_key_atrributes.md
canonical_url: https://help.salesforce.com/s/articleView?id=ind.cg_task_admin_create_custom_key_atrributes.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: e945d7a24488dd43e097e6443a2936d94a531d20da2d949b2df8876fce8122a5
description: Salesforce provides a few standard out-of-the-box key attributes such as customer, product, order, or customer sets. You can define key attributes that aren’t a part of the standard set of attributes by using custom key attributes. With custom key attributes, you can define a special or specific search key.
products:
  - Consumer Goods
release: "264"
---
# Create a Custom Key Attribute

Salesforce provides a few standard out-of-the-box key attributes such as customer, product, order, or customer sets. You can define key attributes that aren’t a part of the standard set of attributes by using custom key attributes. With custom key attributes, you can define a special or specific search key.

### 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;">
              <p>Available in: Lightning Experience</p>
              <p style="margin-bottom:0;">Available in: <strong>Enterprise</strong> and
                <strong>Unlimited</strong> Editions that have Consumer Goods Cloud enabled
              </p>
            </td>

          </tr>
        </tbody>
      </table> <table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d33078e62">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d33078e62 ">To create a custom key attribute:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d33078e62 ">
              <p>(CGCloud Business Admin</p>
              <p>OR</p>
              <p>CGCloud Retail Business Admin)</p>
              <p style="margin-bottom:0;">AND</p>
              <p style="margin-bottom:0;">&nbsp;Penny Perfect
                Pricing</p>
            </td>

          </tr>
        </tbody>
      </table>

These steps apply only to the Consumer Goods Cloud desktop app. If a key attribute is present in the Salesforce org, you can directly add the key attribute without creating a pricing context definition. For more information on standard key attributes, see [Create a Key Attribute](https://help.salesforce.com/s/articleView?id=ind.cg_task_admin_create_key_atrributes.htm&release=264.0.0&type=5 "A key attribute defines a specific object field that the pricing engine uses as part of a condition record search key. Key attributes are the building blocks of key types. A key type combines multiple key attributes to define the exact combination of fields the engine uses to look up a condition record.").

1. From the App Launcher, find and select **Pricing Context Definition**.
2. Click **New**.
3. Provide the API name and alias name for the reference field name and field alias.
4. Provide the required fields and save your changes.
5. From the App Launcher, find and select **Key Attribute**.
6. Click **New**.
7. Provide the key attribute name, description, sales org, source object, and field alias.
8. Save your changes.

![Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-consumer_goods_retail_admin-264-0-0-production-enus/5bb7d7f5-119d-42d0-8596-95e762837019/images/icon_example.png)

Example Condition Search with an additional customer attribute (email).

The image shows the UI to create a pricing content definition for the custom attribute.

![A pricing context definition creation for a custom attribute](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-consumer_goods_retail_admin-264-0-0-production-enus/5bb7d7f5-119d-42d0-8596-95e762837019/consumer_goods_retail_admin/images/cg_retail_pricing_context_definition.png)

The image shows the UI to create the custom key attribute.

![Custom key attribute creation](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-consumer_goods_retail_admin-264-0-0-production-enus/5bb7d7f5-119d-42d0-8596-95e762837019/consumer_goods_retail_admin/images/cg_retail_custom_key_attribute.png)

The Mobility Attribute field must match the field alias given in the Pricing Context Definition.

Create a key type and select the custom key attribute in the key definition section. For more information on penny perfect pricing configuration, see [Setup for Penny Perfect Pricing](https://help.salesforce.com/s/articleView?id=ind.cg_concept_user_pricing_configuration_steps_new.htm&release=264.0.0&type=5 "A typical flow of pricing configuration involves creating of the key attributes, key types, search strategy, pricing condition template, calculation schema, and schema determination.").

Adjust the query `CndCpReadCustomerAttributes` (can be a Product, or Order, or Order Item attribute) in the data source `DsComplex_Pricing_sf` on the modeler and add the custom attribute with the same name as created.

#### See Also

- [Default Pricing Context Fields](https://help.salesforce.com/s/articleView?id=ind.default_context_fields.htm&release=264.0.0&type=5 "The core pricing context includes these fields. To avoid errors, don't use these field or alias names when configuring additional context fields. Account-related and product-related attributes are for condition searches. Only order-related attributes are supported for user exits.")
- [Manage Pricing Context Definition Object Permissions](https://help.salesforce.com/s/articleView?id=ind.cg_admin_manage_pcd_permissions.htm&release=264.0.0&type=5 "For the given permission sets, manually configure the object permission settings on the pricing context definition to specify the type of access that users have to the Pricing Context Definition object.")