Background
This 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 GitHub, and was terribly lazy in performing the bit of cleanup necessary to make that happen. I’ve found the tool to be very helpful in finding issues in the Pricing Waterfall that otherwise would require a lot of clicking through records, and hope it saves you some time as well.
GitHub Repo
Without further ado, here is the repo for the component PricingLogicReview.
Important: This is a very rudimentary tool for CPQ administrators and support teams. As such, there wasn’t much time spent outside of the basic functionality. An additional note is that I wasn’t able to foresee any reuse out of the logic, so stuffed everything in the controller for the sake of simplicity – tsk, tsk. As a very mediocre self-taught ‘developer’, I’m sure the pros out there will find many improvements to make or mistakes to correct!
Create the 2x Apex Classes (don’t forget to add the controller to whatever permission set(s) you use for AuraEnabled classes), LWC, and Custom Label pointing to your QCP….find a home for the component, and play away. There are some pre-conditions as you’ll notice, and please adjust as needed to fit your org.
Price Waterfall Sequence Reminder
Quick reminder on the order of evaluation.
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 |
Thanks Nick. Really appreciate it