Messaging.sendEmail() fails with "No such column 'InformalName' on entity 'Contact'" when VF email template is part of managed package
Last updated 21 days ago ·Reference W-5158360 ·Reported By 26 users
In Review
Summary
Messaging.sendEmail() fails with "No such column 'InformalName' on entity 'Contact'" when VF email template is part of managed package
Repro
1. Create a managed package with a VF Page, Controller Extension & VF email template.
2. Try to send an email to Contacts Email using Messaging.SingleEmailMessage() when user click on a button which invokes above VF page.
3. Email triggering will fail with below error only when referring {!recipient.Name} in the template body.
Error Message:
===========
No such column 'InformalName' on entity 'Contact'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.
Workaround
As a workaround, try to perform an SOQL on Contact before calling the Messaging.SingleEmailMessage().
Contact cnt = [SELECT Id FROM Contact WHERE Id=:targetObject];
Reported By (26)









Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.