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
Biswojeet Ray 11Biswojeet Ray 11 

Lightning Email template error

Hi Team,

When a user is trying to approve an approval request, He is getting error.

I have attached the screenshot of the error also.

It's working in Classic. 

There is an email alert in the approval process as Final Approval Actions.

The used email template in that email alert is classic. 

The subject of the email template ->

{!Opportunity.Name} [{!Opportunity.Opportunity_Number__c}] approved


So please check it and let me know is this the issue with the classic email template or what?User-added image

Thanks a lot,

Best Answer chosen by Biswojeet Ray 11
AnudeepAnudeep (Salesforce Developers) 
Hi Biswojeet, 

I have seen such errors in the past. This is a ClassCaseException(" java.lang.String cannot be cast to java.lang.Number") and it occurs if we try to access a currency field with 2 decimal places - but the actual value has higher decimal places - say 16 decimal places.

See this Known Issue

I recommend checking if you have any currency fields referenced in your email template and round off the values of the field to lesser precision. If that is not the case, try creating a support case to identify the root cause