Loading
Set Up and Maintain Retail Execution
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
          Add Custom Attributes to Penny Perfect Pricing Context

          Add Custom Attributes to Penny Perfect Pricing Context

          Use pricing context definitions to add custom attributes for penny pricing calculations in Consumer Goods Cloud. Use custom attributes to refine condition searches or extend logic in user exits.

          Required Editions

          Available in: Lightning Experience in Enterprise and Unlimited Editions that have Consumer Goods Cloud enabled
          User Permissions Needed
          To add custom attributes:

          CGCloud Business Admin

          OR

          CGCloud Retail Business Admin

          Considerations for Custom Attributes

          Keep these considerations in mind while adding custom attributes by using pricing context definition.

          • Use account-related or product-related attributes only for condition searches via key attributes or key types. Salesforce doesn't support account or product-related custom attributes in user exits.
          • Define only attributes that aren't already in the core context or pricing context. See Default Context Fields.
          • Make sure the combination of Context Section, Source, Reference Field Name, and Sales Org is unique.
          • Define valid fields that exist within the source objects.
          • Avoid defining field aliases that are available in the core context or pricing context definition. The combination of Context Section, Source, Field Alias, and Sales Org must be unique.
          • Define up to 20 attributes per source object and sales org.
          • Avoid adding attributes with the long text data type, which can slow pricing condition searches.
          • Default Context Fields
            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
            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.

          Create a Pricing Context Definition

          Define the custom attributes that you want to use in your pricing condition search or user exits.

          1. From the App Launcher, find and select Pricing Context Definition.
          2. Click New.
          3. Enter a name and select a sales org.
          4. Select a context section, such as Order Information, Account Information, or Product Information. This selection defines the pricing context section where you add the new attribute.
            Account-related and product-related attributes are for condition searches. Only order-related attributes are supported for user exits.
          5. Select a source object.
            Salesforce filters the Source list based on your context section selection.
          6. Enter a field name (including namespace) that matches the API name of the field in the source object.
          7. Enter a field alias.
            The alias must be the same for the data source of the offline and online mobile apps.
          8. Save your changes.

          ​​After you define the pricing context, define how the attributes are used.

          Custom Attribute in Pricing Condition Search

          Customize your pricing logic by using custom attributes to define key attributes and key types that align with specific product or account criteria.

          1. Create a key attribute with Mobility Attribute as the Field Alias in Pricing Context Definition.
          2. Create a key type with Distribution Category as To All.
          3. Create and activate a search strategy.
          4. Add a search step:
            1. Set Customer Hierarchy and Product Hierarchy to No.
            2. Select Exclusive to stop the search when a match is found.
          5. Prepare and integrate the pricing conditions.
          6. Create a pricing condition template and select the search strategy.
          7. Create an order, calculate the price, and verify the pricing information.

          Custom Attribute in User Exit

          Use custom attributes in user exits that trigger custom calculation logic during the order process.

          1. Configure the user exit based on the criteria with the custom attribute.
          2. Create an order, calculate the price, and verify the pricing information.
          Example
          Example This sample user exit calculates a specific base price for the Empower Cola 1,0 L PET product.
          /**  Affected Results return the modified calculation results
              It is a JSON Object with following structure:
              currentConditionValue : 
                Holds the current condition value e.g. 19.99 for a base price
              currentCalculationBase :  
                Holds the base of the calculation ... e.g. if you order 10 items and it is a base price then the calculation base is 20
              currentCalculationResult :
                Holds the condition result e.g. 399,80 if you order 20 items with base price 19.99
              currentTotal:                     
                Holds the current value of the order position/item. For base price it is typically equal to currentCalculationResult
                But it can also be different ... e.g. for percentage discounts:
                   current total before step is 200
                   condition value is -10. (Percentage)
                   calculation base is 200 (calculate 10% off of 200)
                   calculation result -20
                   current total 180 (200 - 20)
          **/
          
          
          var AffectedResults = {};
          switch (UserExitId) {
           case "100_CalcResult_BasePrice_ext":
             if (Utils.isDefined(ProductAttributes[0].text1) && ProductAttributes[0].text1 === "Empower Cola 1,0 L PET") {
               AffectedResults.currentConditionValue = 19.99;
               AffectedResults.currentCalculationBase = 20;
               AffectedResults.currentCalculationResult = AffectedResults.currentCalculationBase * AffectedResults.currentConditionValue;
               AffectedResults.currentTotal = AffectedResults.currentCalculationResult;
             }
             break;
          }
          return AffectedResults;
           
          Loading
          Salesforce Help | Article