Loading

'Apex CPU Time Limit Exceeded' error in Salesforce CPQ

Data pubblicazione: Sep 27, 2025
Descrizione
Users may encounter an "Apex CPU Time Limit Exceeded" error message when:
  • Editing or saving Quotes
  • Generating Orders using the out-of-box Order generation method
  • Generating Contracts using the out-of-box Contract generation method
  • Generating Quote Documents using out-of-the-box Document generation method
Risoluzione

The most common reason for seeing the error Apex CPU Time Limit Exceeded in the CPQ package is that the record being created, edited, or renewed is too large. Another common cause is when there is also automation designed to execute in parallel with the CPQ package automation.

Depending on the object, there may be too many Quote Lines, Subscriptions, Order Products, etc. attached to the main object being edited. A large volume of child records is a common cause of transactions failing with CPU Time Limit errors in Salesforce CPQ. If this error occurs during quote calculation, the first thing that you should confirm is that the org is leveraging the Large Quote Performance Settings available to you in the managed package settings. The Quote Batch Size breaks down your quote into smaller chunks for sending back and forth to Heroku.

General best practices in Salesforce CPQ are to avoid writing a trigger, flow, workflow rule, or process builder on the Quote, Quote Line, and Quote Line Group objects whenever possible. These add significant overhead to the save process of Quotes, which involves updates to the Quote Line records (often numbering in hundreds or thousands). Whenever updating fields on these objects, you should attempt to make the updates via a Price Rule or a Quote Calculator Plugin (QCP) as opposed to the Salesforce native automation. The Salesforce CPQ calculation sequence is better optimized to include Price Rules and QCPs.

Automation on Orders and Contracts (and their related objects) can also put an org at risk for CPU Time Limit errors. It's important to remember that Orders and Contracts have related objects that generate at a one-to-one ratio with Quote Lines (or even one-to-one with quantity on Quote Lines). If Price Schedules need to be generated, a full calculation sequence also runs with Order creation. As a result, when Price Schedules are used, generating an Order from a Quote or Opportunity can't handle the same volume of Quote Lines as generating a contract from that same Quote or Opportunity due to the extra calculation and extra records being generated on the Order Products.

For more information related to Apex in CPQ, read our help article that provides tips for troubleshooting Apex Governor Limit errors

If the error occurs during Document Generation, it can be due to factors such as the number of quote lines, quote line groups, size of the quote template, or a large number of image files (or a few larger sized images). The resolution for this is to reduce the number of Quote Lines/Quote Line Groups, or to simplify the Quote Template.

Numero articolo Knowledge

000383156

 
Caricamento
Salesforce Help | Article