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
NK@BITNK@BIT 

Error occurred trying to load the template for preview: Apex CPU time limit exceeded. Please try editing your markup to correct the problem.

I am getting this error when trying to open one of my email template for preview. Can any one tell me why this error is coming and how I can debug this error?
bob_buzzardbob_buzzard
This usually means that you are pulling a large amount of data into the template, or are carrying out a *lot* of processing server side in order to generate the email.  I'd have the developer console open when previewing and see if the logs can point at the bottleneck.

I have also seen this happen due to a salesforce problem, where a VF page that typically rendered in 2 seconds suddenly started taking minutes and timing out.  In this situation it was just a waiting game until Salesforce resolved the problem,.