Discussions
- General Development
- Schema Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules
- Security
- Mobile
- Force.com Sites & Site.com
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby
- Desktop Integration
- APIs and Integrations
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- AppExchange Directory & Packaging
- Salesforce Labs & Open Source Projects
- Other Salesforce Applications
- Jobs Board
- Force.com Discussion Boards
- :
- Developer Boards for Force.com and Database.com
- :
- Formulas & Validation Rules Discussion
- :
- Re: HTML Template Merge Fields - using related obj...
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
HTML Template Merge Fields - using related object fields
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
11-09-2012 05:18 PM
Hello. I have an e-mail template that is used by a workflow e-mail alert. The e-mail alert is based on the workorder__c field. I also have a related object (via lookup relationship) called parts__c.
I am able to display the workorder__c.workordername__c field values in e-mails created from this template. However, I am getting blanks where I am trying to display parts__r.partname__c.
In short, is there any way to display data from related objects in an HTML template...or can you only display data from a specific object?
Hope this makes sense. Thanks in advance.
Re: HTML Template Merge Fields - using related object fields
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
11-13-2012 06:58 AM
So the email template is based on the Workorder object or a different object?
Got KUDOS?
Re: HTML Template Merge Fields - using related object fields
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
11-13-2012 07:04 AM
Ok, I believe I know your problem.
You are trying to independently include fields from a related object but without the relationship. Based on parts__r.partname__c, there is no reference to the workorder that the part is related to.
Instead of parts__r.partname__c, try workorder__r.parts__r.partname__c
Got KUDOS?
Re: HTML Template Merge Fields - using related object fields
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
11-13-2012 08:21 AM
Thanks. I appreciate the help. Unfortunately, that did not work. I have been doing some further searching and I saw a passing reference somewhere about problems with referencing related objects' values in HTML email templates.
My workaround to this was to just create a formula field in the workorder object. That way, all of the fields I need are in the workorder object.
Thanks for the suggestions though.
Re: HTML Template Merge Fields - using related object fields
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
11-13-2012 08:31 AM
Just my personal experience testing this out:
In my dev org, I have an object that has a lookup relationship to Accounts, called Bogus Test Object.
In an email template, for me to populate the name of the Bogus Test Object that is related to the Account that the email is being sent from, I have to use the merge field {!Account.Bogus_Test_Object__c}
But to your point, it appears that I cannot dig into the related objects fields. Youre right, it looks like formula fields are the solution.
Got KUDOS?

