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
nap1nap1 

Object tables and email template

I am looking to get some help with object tables and email templates. I am trying to create an email template that pulls information from two object tables. There are two object tables, the second object table has a relationship with the first object table. 

Example:

Object Table #1 - consist the following information
  • Manufactures company info
    • Name,address,phone#, contact information
Object Table #2 - Consist the following information which is related to Ojected Table #1
  • Employee Information of that manufacturing company
    • Employee name and ID #
Even though object table #2 has build a relationship with object table #1. So when a user looks up manufactures, on the same page they are able to view the employee information. When I create the email template, I can specify and pull all the information from Object table 1, which I would like to display in the email. However in the email where I specify field names from Object table #2, they remain blank when I run the test email. Mainly because the email template can only pull one object at a time it seems in salesforce. 

Im not sure what the best solution to resolve this issue. 
  1. Do I need to create a field in object table #1 to display, names from Object table #2 (and hide the field from view since, since object table 2 is displayed inside of object table 1 page?

I am not an developer, so please bare with me. 

Thank for your help in advance! 
JayOlayJayOlay
Hi nap1 -- You are correct that email templates cannot process fields from multiple objects (https://help.salesforce.com/apex/HTViewSolution?id=000005093&language=en_US). The solution you outlined seems like it would work; alternatively, you would need to develop a Visualforce email template (https://developer.salesforce.com/page/VisualForceEmailTemplates_sample), which is really not as difficult/daunting as it may seem!
nap1nap1
Hi Julien, 

Even with the Visualforce email template I am unable to pull custom object fields. 

I can go with the solution provided but Im not sure how to go about displaying information from other object tables. 

Thanks!
spielsspiels
You can use formula fields, or visualforce templates. However if you use Outlook you can use cross object fields in your templates. It would be nice if this was available in Salesforce too though! You can learn more here (http://www.contactmonkey.com/blog/cross-object-fields-in-salesforce-email-templates-fixed). Basically you can manage your templates in Salesforce but send them from Outlook.