The Universal Invariant
One sentence:
The parent line’s quantity times its bundle price equals the bundle’s total dollar contribution to the opportunity or quote.
In Apex / field language:
parent.Quantity × parent.BundlePrice__c == bundle's total contribution
What “bundle’s total contribution” means depends on which pricing model the bundle uses — but the equation holds in all three:
- Standard and Roll-Up: the parent line absorbs the dollars
(
parent.TotalPrice = parent.UnitPrice × parent.Quantity); children persist withTotalPrice = $0. The bundle’s total contribution isparent.TotalPrice, andBundlePrice__cmatchesparent.UnitPrice. - Itemized: the children carry the dollars (
Σ child.TotalPrice) and the parent’sTotalPriceis $0. The bundle’s total contribution isΣ child.TotalPrice, andBundlePrice__cis that sum divided byparent.Quantity.
Either way, multiplying parent.Quantity × BundlePrice__c gives you the
bundle’s contribution — a stable “what does one of these cost?” answer
that doesn’t shift with quantity edits.
Related
- Pricing Models — the three ways “total contribution” is realized.
- The Big Picture — why display and database never drift.
- Troubleshooting — what to capture when the invariant appears broken.