CPQ Pricing Logic QuickView

Salesforce CPQ is a powerful tool for building configuration and quoting logic, but as is often said….’with great power comes (potentially) great complexity’!

Take as an example the management of Price Rules => Price Actions, and the interaction with other logic employed in the QCP. Keeping track of what fields are being modified in each, and when they are being changed, can be very complicated, and the order of updates makes all the difference.

1System – Twin Field Fill
2Price Rule – On Initialization
3QCP – onInit
4System – Formulas (Q, QL, QLG)
5Price Rule – Before Calculate
6QCP – onBeforeCalculate
7System – Line Qty. Updates
8QCP – onBeforePriceRules
9Price Rule – On Calculate
10QCP – onAfterPriceRules
11System – Target Amount
12System – Totals Reset
13System – Totals Recalculation
14System – Discount
15Price Rule – After Calculate
16QCP – onAfterCalculate
17System – Formulas (QL, QLG, Q)
18System – Totals Calculation
19System – MDQ Summary

I suppose this will be a niche topic for CPQ nerds, so I’ll cut straight to the chase. After much annoyance searching QCP and Price Actions, I’ve started a little tool that consolidates the two.

What does this tool do?

  1. Price Actions:
    1. Gathers all active Price Actions for Quote Line object Target Fields assigned to Calculator Price Rules.
    2. Breaks those Price Actions into groups based on the Price Rule Calculator Evaluation Event.
  2. QCP:
    1. Evaluates the QCP for the organization and breaks the file into each of the standard QCP methods (onInit, onBeforeCalculate, onBeforePriceRules, onAfterPriceRules, onAfterCalculate).
    2. Scans each method for the field api names called out by ‘line.record[]’.
    3. Breaks these fields into groups based on the QCP method.

Outcome and Tooling:

  1. Results are displayed and sorted based on Sequence in which each of these updates will be processed. Type of update and Timing are also provided.
  2. Select Event‘ picklist is provided to filter by a certain event.
  3. Filter on Fields‘ lets you type in a particular field to filter on only those actions including that field.
  4. Parent‘ provides the location of the field for easy access.

This has ended up being a really helpful time-saver so far. There is a lot more to do, including:

  1. Bringing in Quote-level updates
  2. Differentiating in QCP between fields being updated and fields being referenced to update other fields,
  3. Conditionally highlighting duplicate updates
  4. Filtering out commented fields from the QCP
  5. Bunch of other options as well…

It serves my purpose for now though, so thought I would share, and can take on additional updates if there is interest out there.

Just let me know if this might be helpful and thanks for reading!


  1. Hi Nick – can you share this? We’ve so many price rules and QCP and this will be extremely helpful in troubleshooting.

  2. I have to carve out some time to bring this back up and get in condition for open sourcing it. Please forgive me as Iā€™m no longer working in the area, so getting my own time to work on it is difficult.

Leave a Reply

Your email address will not be published. Required fields are marked *