Price Rules in 5 Mins

Signposts

Price Rules are core to the power of Salesforce CPQ. They can be used to populate one field from logic and can use other fields in this logic. This population can use a formula, roll up of other values, be from a table, via a set value, or even via another field. You can control when price rules fire in multiple ways including if they fire at all. In this blog I will explain the power of Price Rules and why they are loved so much by CPQ specialists, all in 5 minutes.

What is a Price Rule

A price rule is an Object that comes as part of the Salesforce CPQ Managed Package. There are three other CPQ Objects that have a lookup relationship to Rule Rule, these are:

  1. Price Conditions - The conditions required for the Price Rule to fire.

  2. Data Query - If using a lookup Object (we talk about them later), these records determine how to find the right record to use.

  3. Price Actions - What will happen

You don’t need to populate all of these related lists, however if you don’t have a Price Action, your rule won’t do anything.

When does the Rule Fire

There are 4 main ways to control when or if the rule fires. The most obvious of these is the ‘Active’ Check box, if this is false then it will not fire. The other three important controls are:

  1. Order, this is a numeric field on the Price Rule that determines the order in which Price Rules fire.

  2. The required conditions for the rule. This is controlled by the Price Conditions.

  3. Calculator Evaluation Event. This is a multi-select picklist field on the Price Rule which allows you decide exactly when the rule will fire. This field includes options for before, on, or after Calculate as well is if you want it to fire on Initiation. This allows control in the order of execution.

This level of control is so granular that it is often a good place to start if troubleshooting a problem. Especially the Active checkbox, this has caught us all out at some point.

What does it populate?

Price Rules are normally used to populate fields on Quote and Quote Line records although other Objects are available. This is done from the Price Actions records. There can be multiple Price Actions linked with a single Price Rule and you are able to set their running order. Population from a Price Action can take place in multiple ways:

  1. You can populate it with a set value (eg. set a checkbox to TRUE)

  2. You can populate it with a formula. HINT - This is done within a long text field and therefore not subject to the 5,000 compiled size restrictions of formula fields.

  3. You can populate a field with the value of another field. 

  4. You can populate using a the CPQ Object, Summary Variable. A summary Variable is a roll up of values based on criteria, eg Product ARR to the Quote level.

  5. You can populate from a Lookup Object. In this case you can create multiple records on another (often Custom) Object. There is a default Lookup Object supplied in the CPQ managed package called Lookup Data. These objects hold information at a field level, some that are used for finding the correct record via the Lookup Query, and some that are used to populate via the Price Action. In this case, when a Price Rule runs, it will use the Lookup Data records to find the right Lookup Object record (HINT: If there are multiple found it will give an generic error message in the QLE). The Price Rule will then use the Price Action to tell it what to do, ie, which field to take the value from.

Once all this is in place the rule is ready to be tested and the magic can begin. Due to the level of control you have available though there is a lot that could be wrong, as such, here are some hints for you:

  1. It is worth building for future requirements, i.e. using a new Lookup Object for different types of information instead of using a 10,000 character formula even if it feels like overkill at the time. Trust me, your future self will be very happy with you. 

  2. When testing a Price Rule you need to refresh the QLE between changes. You can do this either by refreshing the browser page, saving and reentering the QLE, or by right clicking on the QLE page and selecting refresh (My favourite)

  3. Check in the Installed Package configuration if the ‘Calculate Immediately’ checkbox is checked.

  4. Click calculate multiple times when testing to ensure you are not in a loop.

  5. Test after each change and obviously in Sandbox.

If you do this you should be on your way to getting that rule working for you.

I hope you found this helpful, if you would like help with anything to do with Price Rules, or Salesforce CPQ in general, the please don’t hesitate to get in touch.

Previous
Previous

Product Rules in 5 Mins