Ask Search:
David LiuDavid Liu 

AccountTrigger: System.LimitException: Apex CPU time limit exceeded

I'm simply updating the ownerID for 82 accounts. Why would I have this constraint? 
Best Answer chosen by David Liu
Niranjan GattupalliNiranjan Gattupalli
Hi David,

It is recomended to post this query on developer forum (https://developer.salesforce.com/forums) for faster responses as it is related to Apex. It will be better you post the actual code snippet to analyze if there is any issue with code like unused code or issue with for loops returning lot of records etc.,

Here is an article from Salesforce on how you can address this Apex CPU timelimit exceeded error with best practices : https://help.salesforce.com/apex/HTViewSolution?id=000232681&language=en_US

Pls. mark as best answer if it answers your question.

All Answers

Niranjan GattupalliNiranjan Gattupalli
Hi David,

It is recomended to post this query on developer forum (https://developer.salesforce.com/forums) for faster responses as it is related to Apex. It will be better you post the actual code snippet to analyze if there is any issue with code like unused code or issue with for loops returning lot of records etc.,

Here is an article from Salesforce on how you can address this Apex CPU timelimit exceeded error with best practices : https://help.salesforce.com/apex/HTViewSolution?id=000232681&language=en_US

Pls. mark as best answer if it answers your question.
This was selected as the best answer
David LiuDavid Liu
I'm using simply dataloader, no specific Apex code
Vineet KumarVineet Kumar
It maybe possible that because of your data insert, related trigger and workflows might be executing, that maybe causing this issue. I suggest you use debug log to check the flow of controls and optimise your code.
Malcolm OvuorhoMalcolm Ovuorho
@david, did you get a resolution for this, I got the same error using Dataloader, the link was not really helpful
David LiuDavid Liu
I found that it's because changing the ownerID for certain accounts is triggering other workflows and other processes, causing an Apex API limit. I would go to "Settings --> Batch Size". I would try 5 or something small. 
Srinivasa NaramsettiSrinivasa Naramsetti
Changing the Batch Size from 200 to less number (may be 5 or more based on validations at the backend) solved this error for me.
Rohith Raj ChennaRohith Raj Chenna
Changing batch size from 200 to 20 did the trick for me. Thanks David! 
Edward LarkinEdward Larkin
Changing the Batch Size also worked for us.  Thanks for this, David!
Chad HorenfeldtChad Horenfeldt
Thanks David! That worked.
AjayKumar SaravananAjayKumar Saravanan
I have it exact dumps for SFDC Administrator 201,App Builder and SalesCloud Consultant Summer'19. It's contains accurate 60 to 65 questions with verified answers. You can definitely cleared at first shot (Many of them cleared) and got jobs. 200% Assurance.  If anyone looking for the same Summer'19, pls mail me at - ajaykumar.saravanan65@gmail.com
AjayKumar SaravananAjayKumar Saravanan
I have it exact dumps for SFDC Administrator 201,App Builder and SalesCloud Consultant Summer'19. It's contains accurate 60 to 65 questions with verified answers. You can definitely cleared at first shot (Many of them cleared) and got jobs. 200% Assurance.  If anyone looking for the same Summer'19, pls mail me at - ajaykumar.saravanan65@gmail.com