Salesforce CPQ: Creating Price Rules - Scenario 2

  • Blog
  • Salesforce CPQ: Creating Price Rules - Scenario 2
blog image
14
Feb

Salesforce CPQ: Creating Price Rules - Scenario 2

Suppose your clients want their users to sell ProductY and ProductW but they want to make sure that 1 ProductY is included for every 5 ProductW, and those quantities are always an integer value. This means we'll have to create a price rule that calculates the quantity of ProductY based on how many ProductW the user adds to the quote.

Price Rule Steps for Scenario2

Step 1. First, create a Summary Variable to represent one fifth of the quantity of ProductW across all quote lines.

  1. A. Click the Summary Variables tab from the navigation bar.
  2. B. Click New.
    1.  ►For the Variable Name field, enter a meaningful name that would make sense for you and your colleagues, for example:Total quantity of ProductW divided by 5
    2.  ►For the Target Object field, select Quote Line
    3.  ►For the Aggregate Function field, select Sum
    4.  ►For the Aggregate Field, select Quantity
    5.  ►For the Filter Field, select Product Code
    6.  ►For the Operator field, select equals
    7.  ►For the Filter Value field, enter ProductW
    8.  ►For the Composite Operator field, select Divide
    9.  ►For the Value Element, enter 5
  3. C. Click Save.

Salesforce CPQ New Summary Variable Fields and Picklists 

Step 2. Create a Price Rule that will specify that it will be evaluated on the Quote Line Editor and for calculation events.

  1. A. Click the Price Rules tab from the navigation bar.
  2. B. Click New.
    1.  ►For the Price Rule Name field, enter Set quantity of ProductY based on the quantity of ProductW
    2.  ►For the Evaluation Scope field, select Calculator
    3.  ►For the Evaluation Order field, enter 20
    4.  ►Check the Active checkbox
  3. C. Click Save.

Salesforce CPQ New Price Rule Options on Information Body 

Step 3. Create a Price Condition that makes the rule evaluate only when the quote line product code is ProductY.

A. Click New in the Price Condition related list and set the field values:

 Salesforce CPQ Specified Price Rule Information and Related Options

  1.  ►For the Object field, select Quote Line
  2.  ►For the Field, select Product Code
  3.  ►For the Operator field, select equals
  4.  ►For the Filter Type field, select Value
  5.  ►For the Filter Value, enter ProductY

B. Click Save.

CPQ New Price Condition Fields and Picklists

Step 4. Create the first Price Action that will set the quote line Quantity field to the value of the composite summary variable and set it to run first.

  1. A. Click New in the Price Actions related list and set the following field values:
    1.  ►For the Target Object field, select Quote Line
    2.  ►For the Target Field, enter SBQQ__Quantity__c
    3.  ►For the Source Variable field, enter Total quantity of ProductW divided by 5
    4.  ►For the Order field, enter 1
  2. B. Click Save.

Salesforce CPQ New Price Condition Fields and Picklists

Step 5. Create the second Price Action that will set the quote line Quantity field to a rounded version of its own value and set it to run second.

  1. A. Click New in the Price Actions related list and set the following field values:
    1.  ►For the Target Object field, select Quote Line
    2.  ►For the Target Field, enter SBQQ__Quantity__c
    3.  ►For the Formula field, enter CEILING (SBQQ__Quantity__c)
      1.  (Note: The CEILING function rounds a number up to the nearest integer. There is also the FLOOR function which rounds down a number to its nearest integer.) 
    4.  ►For the Order field, enter 2
  2. B. Click Save.

Salesforce CPQ New Price Action Information Details

Step 6. Verify rule behaves as expected by adding ProductY and ProductW to a quote.

  1. A. Click the necessary quote.
  2. B. Click Edit Lines.
  3. C. Click Add Products.
  4. D. Check ProductY and ProductW.
  5. E. Click Select.
  6. E. Set the quantity of ProductW to 10.
  7. E. Click Calculate.
  8.  (Note the quantity of ProductY is now 2.)

CPQ Quote Line Editor Layout for Scenario2 Price Rule

This is another example of how you can make sure that the correct number of any product is sold depending on the quantity of other products.

Comments (1)

Brendan
Dec 6, 2022

Super helpful! Thank you

Leave a Comment