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
Mahesh NirmalMahesh Nirmal 

Update failed. First exception on row 0 with id **********; first error: TEMPLATE_NOT_FOUND,

Hi all,

I am facing the below error

Exception Details: Update failed. First exception on row 0 with id *************; first error: TEMPLATE_NOT_FOUND, The record couldn't be saved because it triggered an email alert that failed. Please contact salesforce.com Customer Support.: []

The scenario is that we have a WF Rule on the Invoice object which fires the Email Alert after Registration. The Invoice Template is a VF Page.
I researched for it and most of the folks suggest checking the permissions of the fields referenced in the Email template. I do that but still, I am getting the same error.

It's the second time I am facing this particular issue. The first time it was resolved by giving permission to a new field added on the Invoice object. But this time it happens suddenly without adding any new field.

Please suggest a way to resolve it
Thanks.

SwethaSwetha (Salesforce Developers) 
HI Mahesh,
Is this issue happening after the Spring'21 release?
Related:https://salesforce.stackexchange.com/questions/25657/template-not-found-when-workflow-is-fired-from-communties

Thanks
Mahesh NirmalMahesh Nirmal

Hi Swetha,

Thanks for your reply but I tried that out.

SwethaSwetha (Salesforce Developers) 
HI Mahesh,
I recommend performing the below steps to see if that fixes the issue:
1. Add renderUsingSystemContextWithoutSharing="True" attribute to the emailTemplate
2. In the Visualforce Template, check if there are any referenced records not being shared.

If this information helps, please mark the answer as best.Thank you
carlostcarlost
Swetha's answer is correct: use the renderUsingSystemContextWithoutSharing="true" parameter in the VF Email Template