- Home
- /
- Salesforce Testing
- /
- Business Processes
- /
- Price Rule
Salesforce Price Rule Testing
Salesforce price rule testing validates the Salesforce CPQ rules that inject and recalculate values on quotes and quote lines — the conditions that decide when a rule fires, the price actions that write a result, and the evaluation event and order that decide when that result is applied. It proves that the number a rep sees on a quote line is the one pricing strategy intended, every time the quote recalculates.
Price rule coverage is part of the configure-price-quote journeys available for demonstration and proof-of-concept validation.
How CPQ price rules work
A price rule in Salesforce CPQ (SBQQ__PriceRule__c) is a small program that runs inside the quote calculator. Its price conditions compare a field on the quote or quote line against a static value, a variable or another field. When the conditions are met — all, any or a custom condition expression — its price actions write a value into a target field, such as Special Price, Additional Discount, a custom uplift or a quote-level total. A rule can also use a lookup query against a lookup object or a summary variable that aggregates quote lines, so one rule can price a line based on everything else on the quote.
Two settings govern timing. The evaluation event determines where in the calculation sequence the rule runs — On Initialization, Before Calculate, On Calculate or After Calculate — and the evaluation order determines which rule runs first within that event. Because price actions can overwrite each other and later calculation steps such as discount schedules and partner or distributor discounts build on earlier values, the same set of rules can produce different totals if either setting is changed.
Price rules are a component of the wider configure-price-quote testing journey. They are separate from product rule testing, which governs what can be configured rather than what it costs.
The calculation sequence a test has to respect
Where a price rule sits in the CPQ calculation determines which values it can read and which later steps can change its result.
| Evaluation point | What is typically available | What to assert |
|---|---|---|
| On Initialization | Quote and line fields before any price waterfall is calculated | Default values and injected inputs are set before calculation uses them |
| Before Calculate | List price and quantity, before discounts are applied | Special price or list overrides flow into the regular and customer price |
| On Calculate | Values after discount schedules and additional discounts are processed | Discount-dependent actions use the correct intermediate values |
| After Calculate | Calculated net prices and totals | Totals-based adjustments do not undo earlier rules or double-apply |
| Evaluation order ties | Two rules in the same event with the same order | Behavior is deterministic, or the configuration is flagged for correction |
| Summary variable input | Aggregates across quote lines at the time the rule runs | The aggregate reflects the lines the rule author expected to include |
Common price rule failure modes
Price rule defects almost never raise an error. The quote calculates, saves and looks reasonable, and the variance is only found by finance or the customer.
Order collisions
A new rule is given the same evaluation order as an existing one in the same event, and which action wins becomes dependent on internal ordering.
Wrong evaluation event
A rule that should adjust list price runs After Calculate, so its value is written but never flows through the discount waterfall.
Condition gaps
A condition compares a picklist or text value that was renamed in a later change, and the rule silently stops firing for new quotes.
Lookup table drift
A lookup query reads a pricing matrix whose rows were loaded with overlapping ranges, returning the first match instead of the right one.
Calculator scope differences
Rules that depend on fields not included in calculation or on configurator-scoped evaluation behave differently in the line editor and in the configurator.
Recalculation side effects
An amendment or renewal recalculates the quote and a rule reapplies an uplift or discount that was meant to apply only once.
Testing a price rule end to end
SyntraFlow is designed to test price rules through the quote line editor as a rep would, then read the stored quote line values to confirm the calculation result.
Fix the pricing inputs
Seed a quote with known products, price book entries, quantities, discount schedules, lookup rows and account attributes so the expected price for every line is calculable in advance.
Trigger the conditions deliberately
Build one quote where every condition is met and one where each condition in turn is not, so both firing and non-firing behavior are proven.
Calculate as the rep
Add products and calculate in the quote line editor under the sales rep's profile, because field access and editable fields change what the calculator receives.
Assert the price waterfall
Read list, special, regular, customer, partner and net price on each SBQQ__QuoteLine__c record, plus quote totals, and compare to the expected values.
Change an input and recalculate
Edit a quantity, term or account field and recalculate, confirming the rule re-evaluates correctly and does not compound its previous action.
Carry the price forward
Generate the quote document and, where in scope, the order, proving the calculated price persists beyond the line editor into quote-to-contract testing.
Edge cases worth including
These are the inputs most likely to expose a price rule that only works for the example its author had in mind.
- Quantity values at the exact boundary of a lookup range or tier, and one unit either side of it.
- Multi-currency quotes where the lookup object or static action value is stored in a different currency from the quote.
- Bundles where the rule targets option lines, the parent bundle line, or both, and component pricing is set to include or exclude.
- Subscription products with a non-default subscription term, proration and a price rule that reads the effective term.
- Quotes edited by a user without edit access to the target field, to confirm the calculator still writes the action value.
- Very large quotes that approach calculation limits and may switch to background calculation.
- Inactive rules or rules with a changed active flag after a deployment, confirming they neither fire nor block others.
Test data that makes pricing assertions possible
Price rule tests are only as good as their expected values. Every scenario needs a controlled product catalog with active price book entries, discount schedules and their tiers, the lookup object rows the rule queries, and account or opportunity attributes that drive conditions. Those records must be identical across the sandboxes where the tests run, because a single changed lookup row alters results without any metadata change. CPQ test data covers seeding that catalog and keeping it aligned.
Keep the expected values outside the org — in a table maintained with the pricing team — rather than reading them from the same configuration being tested. That way, a test proves the configuration matches the pricing policy, not just that it matches itself.
Suggested test scenarios
A compact set that exercises conditions, sequencing and recalculation.
| Scenario | What it proves | Expected result |
|---|---|---|
| All conditions met | The rule fires and its action writes the target field | Target field holds the configured or looked-up value |
| One condition unmet | Condition logic is evaluated as designed | No action applied; price follows the standard waterfall |
| Two rules, same target | Evaluation order resolves conflicts | The later rule's value wins, or the conflict is flagged |
| Lookup tier boundary | Lookup ranges have no gaps or overlaps | Boundary quantity returns the intended tier |
| Quantity change and recalculate | The rule re-evaluates cleanly | Price updates without compounding the previous action |
| Renewal recalculation | Rules behave correctly on renewal quotes | One-time adjustments are not reapplied |
| Rep versus admin calculation | Field access does not change pricing | Identical net prices for both users |
Keeping price rules safe across changes
Price rules are data records as well as configuration, and they are often changed through data loads between environments rather than metadata deployments. That makes them easy to miss in a normal release review. Comparing rule, condition, action and lookup records between sandbox and production, and rerunning the pricing scenarios after every change, catches the drift that otherwise reaches customer quotes. Configuration drift checks help identify when CPQ records diverge between orgs.
Managed package upgrades to Salesforce CPQ can also change calculator behavior. Rerunning the same price rule suite as part of CPQ regression testing gives pricing and finance teams evidence, line by line, that totals are unchanged after an upgrade.
Related pages
Business Processes
The full library of Salesforce business process tests price rules belong to.
Configure-Price-Quote Testing
The end-to-end CPQ journey in which price rules are one step.
Product Rule Testing
The companion rule type that governs what can be configured on a quote.
Salesforce CPQ Testing
Broader coverage of the CPQ package, calculator and quote experience.
CPQ Test Data
Seeding the catalog, lookup rows and discount schedules pricing tests depend on.
CPQ Regression Testing
Rerunning pricing scenarios after package upgrades and configuration changes.
Price Rule testing FAQs
What is Salesforce price rule testing?
It is testing the Salesforce CPQ price rules that set or adjust values on quotes and quote lines. A test confirms that conditions fire only when intended, that price actions write the correct value, and that the evaluation event and order produce the expected net price and quote total after calculation.
Why does evaluation order matter so much?
Multiple rules can write to the same field or depend on each other's output within the same evaluation event. The order decides which value survives and what later rules read. A small change to one rule's order can therefore change prices on quotes that never mention that rule.
How do you know the expected price for a test?
Expected values should come from the pricing policy, maintained with the pricing or deal desk team, and from controlled test data with known list prices, tiers and lookup rows. Deriving expectations from the same org configuration being tested would only prove the configuration agrees with itself.
Should price rules be tested in the configurator as well as the line editor?
Yes, when rules are set to evaluate in the configurator. Configurator-scoped rules can behave differently because fewer quote lines exist at that point and summary variables return different aggregates. Testing both surfaces confirms the rep sees consistent pricing wherever they configure.
How is price rule testing different from product rule testing?
Price rules change values — prices, discounts and totals. Product rules decide what can be selected, which options are required or excluded, and whether a configuration is valid. They fail differently and need different assertions, so each has its own page and scenarios.
Is price rule testing available in SyntraFlow today?
Price rule scenarios are part of the configure-price-quote coverage available for demonstration and proof-of-concept validation. The rules, products and calculation paths in scope are confirmed per engagement.
Prove every quote line prices as designed
Bring a set of price rules and a pricing policy, and see how they can be turned into repeatable, line-level assertions.