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
Vijayakumar KenchugunduVijayakumar Kenchugundu 

Apex CPU time limit exceeded in Process Builder

Hello Friends,

Hope you are doing well. I have created a process builder on Account object for two events:
1st event: Child account create/update should fetch few fields info from it's Parent account
2nd event: Parent account update should cascade down all common fields on child account.

If I have 1st event scnario only, it works fine.
But in case of 2nd event sceanrio, Parent update event calling child update event and its exceeding Apex CPU governor limit (see the below image for error). This is only happening when a parent account has more than 200 child accounts. Is there any option in process builder to avoid this recursive update. 
Your thoughts are highly appreciable.
User-added image
Thanks
Vijay
Best Answer chosen by Vijayakumar Kenchugundu
Vijayakumar KenchugunduVijayakumar Kenchugundu
I resolved my issue with replacing an normal Apex Trigger with static class variable set to false to avoid recursive calling.

All Answers

mukesh guptamukesh gupta
Hi VIjay,

You need to deactivate your process builder and use this code in Apex class with asynchronous process then you will not face this type of error.


if you need any assistanse, Please let me know!!

Kindly mark my solution as the best answer if it helps you.

Thanks
Mukesh 
Vijayakumar KenchugunduVijayakumar Kenchugundu
Hi Mukesh,

Thanks for your response. I am new to this Apex coding. It would be helpful if you share some samples.

Thanks
Vijay
Vijayakumar KenchugunduVijayakumar Kenchugundu
I resolved my issue with replacing an normal Apex Trigger with static class variable set to false to avoid recursive calling.
This was selected as the best answer