CPQ · Salesforce

CREATE A PRICE RULE IN SALESFORCE CPQ

Price Rules automate price calculations and update quote line fields. Price Rules can be created to target either the ‘Configurator’ or the ‘Calculator’ on the Quote Line Editor. In this blog, a Price Rule is created to update the fields in Quote Line when a field ‘RefreshPricing’ in Quote object is set to true.

The Price rule record contains Price rules, Price Conditions and Price Actions.

Price Rules – To create or modify a price rule, enter the information in the appropriate fields.

Price Condition – A price condition compares a field value, summary variable, or formula against another field value, summary variable, or formula. A rule can have multiple conditions .

Price Actions – When the price rule meets its conditions, the rule applies its price actions to a target field. A price action gets the value from a summary variable, formula, user-defined value, or other quote line field and sends that value to the target field. A price rule must have at least one action.

Let us see an example of creating a Price rule to update the discount value in Quote Line when it meets the Price Condition(ProductCode = ‘Test Product’).

  1. Create a Price rule with the following values.
  • Enter the ‘Name‘ of the Price Rule as ‘Update Discount for Product X’.
  • Enter the ‘Evaluation Order‘ as 10, which specifies the order in which the rule has to be executes.
  • Set ‘Evaluation Scope‘ as Calculator. It is from where the rule should be triggered. It can be either Calculator or Configurator.
  • Select the ‘Calculator Evaluation Event‘ as ‘On Calculate’. This the name of the calculator event during which the price rules will be triggered. This is selected when evaluation scope is set to calculator.
  • Select ‘Conditions Met‘ field to All. If ‘Custom’ is selected, then enter the condition in Advanced Condition field.
  • Enter the field names which gets updated through this rule in ‘Price Action Target Fields’. For this example enter ‘SBQQ__Discount__c(Quote Line)’.
  • Save the record.

2. Create Price Condition for the rule created above through the related list of Price Rule and enter the following values. The condition we are trying to create is SBQQ__ProductCode__c = ‘Test Product’.


  • Set a unique number to ‘Index‘ field as ‘100’ to refer the condition in ‘Advanced Condition’ field in Price Rules object.
  • Select the ‘Price Rule’ as ‘Update Discount for Product X’ for which the condition should be evaluated.
  • Select the ‘Object‘ name of the field for which the condition should be evaluated.
  • Select the ‘Field‘ name as SBQQ__ProductCode__c.
  • Select the ‘Operator‘ as equals.(Values can be greater than, lesser than, starts with, etc).
  • Select the ‘Filter Type‘ as value. If value is selected, enter ‘Field Value‘ as ‘Test Product’. In ‘Filter Type‘ if variable is selected, enter the variable name in ‘Filter Variable‘ field. In ‘Filter Type‘ if formula is selected, enter the formula in ‘Filter Formula‘ field.
  • Save the Record.

3. Create Price Action for the action to be taken when the condition becomes true. Here we are updating the SBQQ__Discount__c field value to 100 when product code is ‘Test Product’.

  • Select the ‘Price Rule’ as ‘Update Discount for Product X’ for which the condition should be evaluated.
  • Enter the ‘Order‘ value as 1 which specifies the order in which the actions should be executed.
  • Enter ‘Value‘ field as 100 which is the value which has to be assigned to assigned to Target field when conditions are met.
  • Enter ‘Target Object‘ as SBQQ__QuoteLine__c which is the name of the object on which the field has to be updated.
  • Enter ‘Target Field‘ as SBQQ__Discount__c which is the name of the field which has to be updated.
  • Save the record.

Once the price rules along with conditions and actions are created, whenever a quote/quote line is saved the price rules are triggered and if the conditions are met, appropriate field value gets updated based on the price action defined.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s