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
RichardR1RichardR1 

Apex trigger and data import wizard

I'm very new to development. We have a trigger that I think is bulkified but still I am getting errors whenever I mass update more than 200 contacts using Data Import Wizard.

What I don't understand is why only the first 200 contacts fail and then all other contacts in excess are updated successfully, even though they are on the same CSV upload. Does anyone know why this is the case?

Best Answer chosen by RichardR1
ShirishaShirisha (Salesforce Developers) 
This could be because of the data which is being processed which needs the code optimization.

Also,I would suggest to enable the debug logs while updating the records and see which part of the code is causing the issue here.

Please check the below doc to avoid getting CPU time limit exceeded error.

https://help.salesforce.com/articleView?id=000339361&language=en_US&type=1&mode=1

Thank you!

All Answers

ShirishaShirisha (Salesforce Developers) 

Hi Richard,

Greetings!

Can you please provide the error message that you can see whenever the records get failed as it depends on the error message that get.

Also,please refer the below documentation which will provide you insights on the mass updates using Import Wizard.

https://help.salesforce.com/apex/HTViewSolution?id=000267082&language=en_US

Kindly let me know if it helps you and close your query by marking it as best answer so that it can help others in the future.

Warm Regards,
Shirisha Pathuri

RichardR1RichardR1
CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY:updateColloquialConsultingFirm: System.LimitException: Apex CPU time limit exceeded:--
ShirishaShirisha (Salesforce Developers) 
This could be because of the data which is being processed which needs the code optimization.

Also,I would suggest to enable the debug logs while updating the records and see which part of the code is causing the issue here.

Please check the below doc to avoid getting CPU time limit exceeded error.

https://help.salesforce.com/articleView?id=000339361&language=en_US&type=1&mode=1

Thank you!
This was selected as the best answer