+ Start a Discussion
BWagsBWags 

Email Template & Relationships

I have an email template that will be used when emails are sent from a custom object I created (let's call it MyCustomO).
MyCustomO has a lookup field to another custom object I created (MyOtherCustomO).
 
My question is this.  How can I, or can I, use fields from MyOtherCustomO in the email template and get them to work.  Currently when I try to do this it is just left blank in the email where the related data is supposed to be.
 
So I want something like this:
 

 
Dear {!MyCustomO__c.Name__c},
 
I see here that you have decided to look into {!MyOtherCustomO__r.Product__c}.
 

I just don't want to have to put all the fields I want out of MyOtherCustomO into MyCustomO, it just seems like I'd be filling everything out twice.

Thanks to anyone who can assist me on this and offer up any advice.

vasvas
This looks like a long outstanding issue (I see messages that are more than 3 years old with exactly same issue), and I'm surprised that it still hasn't been addressed.
I have a similar issue, and in my case the other object is standard object (Account). My workflow rule is on a custom object which has a lookup relationship to Account object. In the email template, I have merge fields from both custom object and Account object, but only the fields from custom object display values in the emails.
 
And, here's something interesting- if I change the lookup relationship to master-detail (Account being the master) then only the fields from Account object work, and the custom object's fields are all blank although my workflow rule is on the custom object.
 
So, looks like if the workflow rule in on a custom object, then only one object can be used in the templates.
 
Any word form Salesforce.com on this? Is there a plan to address this issue?
BWagsBWags
Yeah it appears that for some reason, I can't imagine why, you can't do this.  If anyone knows a way that you can PLEASE post how to accomplish this.
vasvas
I was a bit wrong about the master-detail situation. It actually works, and I can see values from both the custom object and its parent object in the emails. But thats not a complete solution. I need to be able to get values from other related objects as well. I just got a confirmation from Salesforce.com support that lookup relationships are not supported in email templates.

Message Edited by vas on 04-11-2008 03:33 PM