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
Wendy M GriffinWendy M Griffin 

Data Loader returning unusual error

Hi all,

The following error is being returned when attempting to load a file via Data Loader:

updateCase: execution of BeforeInsert
caused by: System.LimitException: Apex CPU time limit exceeded
Trigger.updateCase: line 7, column 1

Any ideas what may be causing the error and how to correct?

Thank you,
Wendy
Vigneshwaran GurunathanVigneshwaran Gurunathan
The Maximum CPU time on the salesforce servers - 10,000 milliseconds (Synchronous limit) 60,000 milliseconds(Asynchronous limit).

There is a possibility that the object being loaded have a trigger which runs so long and exceeds 10s limit.

Please check below post to know how to resolve this issue
http://salesforce.stackexchange.com/questions/22223/how-to-code-more-efficient-to-avoid-apex-cpu-time-limit-exceeded
http://salesforce.stackexchange.com/questions/47035/errorsystem-limitexception-apex-cpu-time-limit-exceeded

Hope it helps.
 
NagendraNagendra (Salesforce Developers) 
HI Wendy,

As per the Salesforce documentation below, Maximum CPU time on the Salesforce servers for Synchronous is 10,000 milliseconds and for Asynchronous, it’s 60,000 milliseconds.

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_gov_limits.htm

CPU time is calculated for all executions on the Salesforce application servers occurring in one Apex transaction—for the executing Apex code, and any processes that are called from this code, such as package code and workflows. CPU time is private for a transaction and is isolated from other transactions. Operations that don’t consume application server CPU time aren’t counted toward CPU time. For example, the portion of execution time spent in the database for DML, SOQL, and SOSL isn’t counted, nor is waiting time for Apex callouts.

Please optimize you code to execute with the limit to avoid the issue.

Kindly mark it as best answer if it helps you.

Best Regards,
Nagendra.P

 
Siddharth83JainSiddharth83Jain
Technically what other have mentioned is correct but from code point of view there might be unnecessary processing happing in between for loops possibly, this is most common issue. Can you share the UpdateCase trigger snippet so I can have look and suggest.

Kindly mark it as best answer if it helps you.

Thanks
Siddharth
OSI Consulting
UC InnovationUC Innovation
The CPU limit is due to code taking too long to run, which could be due to a lot of different reasons.  Try to reduce the batch size of Data Loader first to see if it helps:

https://help.salesforce.com/HTViewHelpDoc?id=configuring_the_data_loader.htm

Try setting the batch size to 1, for example.  This means that Salesforce will only process one record at a time, which should help reduce the processing time.