Apex CPU time limit exceededYou are using a Vicasso application and encounter an error that includes the message 'Apex CPU Time Limit Exceeded.'Oct 20, 2021Knowledge
InformationPermalinkHelp Permalinkhttps://kb.vicasso.com/?kb=000004331SymptomsYou are using a Vicasso application and encounter an error that includes the message 'Apex CPU Time Limit Exceeded.'SolutionsSalesforce Governor Limits allow up to 10 seconds of CPU time per transaction.This error can happen for a variety of reasons, such as a large amount of automation (Apex Code / Workflow) and/or a large amount of records being processed at a single time. The error can also present itself in a variety of ways.1. If you encounter this error when utilizing the components of a Vicasso application, such as merging cases with Case Merge Premium or sending an email with Email to Case Premium, please open a support case for further diagnosis by sending an email to support@vicasso.com.2. This error is often seen when performing a mass import/update of records through an ETL tool (such as the Salesforce Data Loader). For example, Email to Case Premium customers may see an error during a data import such as 'CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY: E2CP.AutocreateContacts: System.LimitException: Apex CPU time limit exceeded.'Unfortunately, this error doesn't accurately represent where CPU resources are actually consumed. Rather, Email to Case Premium triggers may be first to run after local automation has consumed all available CPU resources, thus preventing this additional managed automation from running. The specific automation consuming CPU resources can be confirmed by collecting a debug log on the running user at the time of the error.For errors experienced during an ETL action, try adjusting the batch size in your ETL tool to process a smaller number of records per batch. (For example, if your batch size is set to 200, try adjusting it to 50 and re-attempt the import / update.)If you're using the Salesforce Dataloader as your ETL tool, please refer to the following Salesforce Documentation for information on how to adjust your batch size.For additional references on the Apex CPU Time Limit Exceeded error, please review the following linked articles:What Is ‘Apex CPU Time Limit Exceeded’ & How Do You Solve It?System.LimitException: Apex CPU time limit exceededApex CPU time limit exceeded ErrorsCode more efficiently to avoid 'Apex CPU time limit exceeded'Please Note: When updates occur to cases, all Apex Triggers on the case object will run (regardless of if they actually perform any specific update/insert actions). This includes the AutoCreateContacts trigger, even if the Auto Add New Contacts settings are disabled. This is standard Salesforce behavior.If determined through a debug log that the Vicasso managed package is not overconsuming the available CPU resources, further troubleshooting is considered outside of the scope of support. To review more on the scope of support, please refer for the following knowledge article.StatusAdditional InformationTitleApex CPU time limit exceededURL NameHelp URL NameApex-CPU-time-limit-exceeded