Loading
Salesforce now sends email only from verified domains. Read More
Manage Your Quotes with CPQ
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          CPQ Quote Calculation Stages

          CPQ Quote Calculation Stages

          When an action causes a calculation, the Salesforce CPQ Advanced Quote Calculator runs through a series of steps to determine pricing for quote lines and quote. (Salesforce CPQ Managed Package)

          Required Editions

          Available in: Salesforce CPQ Spring ’16 and later.

          When you perform an action that starts a calculation, the Salesforce CPQ advanced quote calculator performs these actions.

          Important
          Important If a user or process changes a product during calculation, data from the new product is not available until a new calculation begins.

          Loading and Initialization

          1. Loads products and options
          2. Loads lookup relationships
          3. Retrieves formula field metadata
          4. Executes price rules where the value in the Event field is On Initialization
          5. Initializes plugins, if you have any
          6. If the plugin was initialized, execute the plugin’s onInit() method
          7. Updates related records in case the plugin or price rules sent new IDs

          First Round of Calculations

          1. Calculates formula fields on the quote lines
          2. Calculates formula fields on the quote
          3. Calculates formula fields on the quote line group
          4. Executes price rules where the value in the Event field is Before Calculate
          5. If you’re using a plugin, execute the plugin’s onBeforeCalculate() method
          6. Updates related records in case the plugin or price rules sent new IDs

          Second Round of Calculations

          1. Calculates line quantities
          2. If you’re using a plugin, execute the plugin’s onBeforePriceRules() method
          3. Executes price rules where the value in the Event field is On Calculate
          4. If you’re using a plugin, execute the plugin’s onAfterPriceRules() method
          5. Updates related records in case the plugin or price rules sent new IDs
          6. Ensures that any discount schedules injected by price rules have loaded properly
          7. Indexes line item quantities according to schedule and group keys
          8. If the quote contains a target amount, reset the quote’s discounts
          9. Resets quote and group totals

          Third Round of Calculations

          1. Calculates fixed items
          2. Calculates dynamic items
          3. Calculates totals
          4. If the quote contains a target amount, apply discounts proportionally across the quote so that the quote reaches the target
          5. Combines identical bundle components into one quote line
          6. Executes price rules where the value in the Event field is After Calculate
          7. If you’re using a plugin, execute the plugin’s onAfterCalculate() method
          8. Updates related records in case the plugin or price rules sent new IDs

          Final Evaluations and Updates

          1. Evaluates quote line formula fields again
          2. Evaluates quote line group formula fields again
          3. Evaluates quote formula fields
          4. Calculates totals for groups and the quote again, since line-level totals may have changed
          5. Summarizes MDQ segments and related fields
          6. Deletes plugin modules, if any
          7. Updates related records in case the plugin or price rules sent new IDs

          To detect upserts of Quote Lines that will later be rolled back, you can examine SBQQ__Incomplete__c field, which is set to TRUE during the rolled-back transaction.

          Important
          Important
          • Salesforce CPQ prevents users from chaining multiple calculations within one transaction. This limit ensures that Salesforce CPQ stays within the Salesforce platform governance limits. Salesforce CPQ sets a flag the first time that CPQ triggers run for calculations that prevent the trigger from firing again. As a result, workflow rule and process builder updates to a calculating field don’t cause a second calculation.
          • Block price products populate List Price on the “Calculates fixed items” calculation stage.
          • To avoid issues with JavaScript’s floating point arithmetic, equality-based formulas on quotes and quotes lines must use ROUND() on Currency values.
           
          Loading
          Salesforce Help | Article