Skip to main content

#CPU Timeouts2 utenti parlano di questo argomento

I have a custom object called "Sales targets" this is for tracking the sales of bussiness. The Sales targets id should be updated in related opportunities (one to many) based on region and  Business unit. We are getting a timeout when updating the opportunities due to the volume of related opportunities against a target.  

 

Is there any solution for this, like updating the opportunities in batches , incremental jobs, Custom tables to store the updated data to exclude when selecting the opportunities for updating etc. 

 

 

 

#Salesforce Developer  #Custom Objects  #Salesforce Admin  #CPU Timeouts  #Timeout Issue

1 risposta
  1. 2 set, 15:09

    Hi Robin, the timeout is because you are updating every matching Opportunity in one synchronous transaction when the target changes, that will always blow the CPU or DML limits at volume. The fix is to move it async and only touch rows that actually need it. 

     

    1. Do the mass update in Batch Apex (or a chained Queueable), not directly in the trigger or flow. Batch processes the opportunities in chunks of 200 in separate transactions, so each chunk stays under limits and the whole set completes without a timeout. 

    2. Filter to a true delta instead of re-updating everything. In the batch query, select only the opportunities that still need the change, for example where the Sales Target lookup is null or different AND region and business unit match. That is your exclude-already-updated idea, but done in SOQL, so no separate custom table to track it. 

    3. Better long-term, flip the direction. Rather than the Sales Target pushing its Id onto thousands of Opportunities, resolve it on the Opportunity side: a before-save flow or trigger on Opportunity sets the Sales Target lookup from that record's own region and business unit when it is created or edited. Then the work is spread across individual cheap saves, and a target change only needs a one-time async backfill of existing records. 

     

    Net: async batch fixes the immediate timeout, the SOQL delta keeps re-runs cheap, and maintaining the link on the Opportunity side avoids the giant bulk update going forward. 

     

    if this helps, please mark it as the Best Answer so it helps the next person, thanks 🙂

0/9000

Hi everyone, 

I am trying to edit our Kanban Board and add a Work status to a column.  I click on Configure Board. Then click the column I want to manage. Scroll down and select the Work status I want to add to the column. Then click Save. 

After 30 seconds or more I receive a generic error: CPU Time Limit Exceeded. I have tried different times of day, and different days. Two co-workers have tried as well and have the same issue. 

I then went to our full sandbox, and after 3 attempts was finally successful on the 4th attempt. 

Salesforce support analyzed a debug log and confirmed the problem is not on the server side, it is the AA managed package causing the issue. 

 

Any thoughts on how I can save the change without receiving the error?

Agile Accelerator - Apex CPU  time limit exceeded when modifying Kanban Board

 

#AwesomeAdmins #CPU Timeouts #CPU Limit

1 risposta
  1. Khyati Mehta (InfinySkills) Forum Ambassador
    13 lug 2025, 16:08

    Hello Laura, 

     

    That CPU time limit error you're getting while updating the Kanban Board in Agile Accelerator is likely due to the managed package running too much Apex behind the scenes when saving the changes. Since it's a managed package, there's not much you can tweak directly in the code, but you can try a few workarounds. Try doing the update in an incognito window or a different browser to avoid any caching issues. Also, see if you can temporarily reduce the number of records or columns on the board — that can ease the processing load. Some users have had better luck by cloning the board and then making edits to the cloned version. If you’ve got any custom automation on Work or Status objects, try disabling it just while you make the update. And since you were successful after a few tries in the sandbox, trying again during off-peak hours might help. If all else fails, ask Salesforce to escalate it to the Agile Accelerator team — they might be able to suggest a fix or workaround.

0/9000

Has anyone had issues with rollup helper creating issues with CPU time limits?

 

We have an FTP integration that is scheduled for midnight and typically has no issues. As soon as we enabled rollup helper premier and real time updates, we had issues with the records not updating via FTP integration. Below is the error we received on these records.

 

We can't save this record because the “Auto Check Uncheck Create or Update Swipeclock User� process failed. Give your Salesforce admin these details. This error occurred when the flow tried to update records: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY: rh2.PS_Contact: System.LimitException: Apex CPU time limit exceeded. You can look up ExceptionCode values in the SOAP API Developer Guide. Error ID: 1421716531-10877

2 commenti
  1. 30 lug 2020, 13:59
    Thank you Jacob - this is extremely helpful! I have reach out to support for some additional clarification.
0/9000

Anyone seeing serious performance issues with email notification workflows in scratch orgs? We're seeing CPU timeouts on those alone in bulk cases.

1 commento
  1. 18 feb 2019, 17:37

    We've gone ahead and opened a case on this #21711909 We think it's a general salesforce issue but is exacerbated by scratch orgs to the point of failure.

    CC

    @Dileep Burki
0/9000