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.
Sequence | Action |
---|---|
1 | System – Twin Field Fill |
2 | Price Rule – On Initialization |
3 | QCP – onInit |
4 | System – Formulas (Q, QL, QLG) |
5 | Price Rule – Before Calculate |
6 | QCP – onBeforeCalculate |
7 | System – Line Qty. Updates |
8 | QCP – onBeforePriceRules |
9 | Price Rule – On Calculate |
10 | QCP – onAfterPriceRules |
11 | System – Target Amount |
12 | System – Totals Reset |
13 | System – Totals Recalculation |
14 | System – Discount |
15 | Price Rule – After Calculate |
16 | QCP – onAfterCalculate |
17 | System – Formulas (QL, QLG, Q) |
18 | System – Totals Calculation |
19 | System – 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?
- Price Actions:
- Gathers all active Price Actions for Quote Line object Target Fields assigned to Calculator Price Rules.
- Breaks those Price Actions into groups based on the Price Rule Calculator Evaluation Event.
- QCP:
- Evaluates the QCP for the organization and breaks the file into each of the standard QCP methods (onInit, onBeforeCalculate, onBeforePriceRules, onAfterPriceRules, onAfterCalculate).
- Scans each method for the field api names called out by ‘line.record[]’.
- Breaks these fields into groups based on the QCP method.
Outcome and Tooling:
- 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.
- ‘Select Event‘ picklist is provided to filter by a certain event.
- ‘Filter on Fields‘ lets you type in a particular field to filter on only those actions including that field.
- ‘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:
- Bringing in Quote-level updates
- Differentiating in QCP between fields being updated and fields being referenced to update other fields,
- Conditionally highlighting duplicate updates
- Filtering out commented fields from the QCP
- 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!
Hi Nick – can you share this? We’ve so many price rules and QCP and this will be extremely helpful in troubleshooting.
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.
Thanks Nick. Really appreciate it. If you’ve source code and load it to git that would very helpful
Hi Gaurang – finally got this up to GitHub. Please see this article for explanation and link: https://archwise.io/cpq-pricing-logic/
[…] is a quick follow-up post to ‘CPQ Pricing Logic Quickview‘ from a while back. I received a few requests to make the demonstrated component available on […]
Thanks Nick. I was checking every week. really appreciate it š
Oh no – so sorry. I was really caught up and kept putting this off!