function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Snehal Khot 3Snehal Khot 3 

Urgent:Getting CPU time limit exceeded error while updating cases using custom mass edit functionality.

Getting CPU time limit exceeded error while updating cases using custom mass edit functionality.
I have created visualforce page to mass edit the cases. While updating cases I am getting CPU time limit excceded error.

I have checked debug and found it is taking time to execute process builder and workflow rule. Arround 80% time is taken by process builders and workflow rules. I tried to optimize process builder but it is not working when I am deactivating process builder, it is working fine.

What could be the isuue?
Deepesh Rao 9Deepesh Rao 9
mass edit causes this issue, process builders take alot of time to execute and since you are updating the records synchronously the time limit is pretty less, the solution would be deactivate the process builders and update the records
Snehal Khot 3Snehal Khot 3
Thank you Deepesh. I have created "Mass Edit" list view button on case object to update cases in bulk, so everytime I can not deactivat the process builder. Is there any other workarround for this? 
Deepesh Rao 9Deepesh Rao 9
Check whether if any redundant process builders are there like the process builders and workflows are performing the same logic and follow apex best practices to avoid this issue from a code base perspective