You need to sign in to do that
Don't have an account?
TehNrd
Cross object values in a email template?
Is it possible to have a cross object value in an email template? On the Lead object I have a lookup field (Primary_Contact__c) to a user. Is there anyway to get user fields on this template with workflow from the Lead object.
I have tried with no luck:
{!Lead.Primary_Contact__c.Title}
{!Lead.Primary_Contact__r.Title}
When saving it reverts to this:
{!Lead.Primary_Contact__c}
{!Lead.Primary_Contact__r}
Thanks,
Jason
I have tried with no luck:
{!Lead.Primary_Contact__c.Title}
{!Lead.Primary_Contact__r.Title}
When saving it reverts to this:
{!Lead.Primary_Contact__c}
{!Lead.Primary_Contact__r}
Thanks,
Jason
Hi Jason,
Since you have a lookup to User, you can create cross object formula fields that pull data from the User fields. Then these custom fields can be in your email template.
Hope that helps,
Sati
Another option is also using Visualforce Email Templates. The email template is a visualforce page using the messaging:emailTemplate component. You can then set the relatedToType attribute to User to pull cross object data using {!relatedTo.XXX} tag.
I cannot make this work either using standard e-mail templates.
If workflow rule is defined on Object X which has master or lookup relationship to Object Y, and if I use
X.Y__r.FieldName, I get blank in the actual e-mail.
Hello All,
We're just about to try the VF template approach, but I was curious if anyone was able to get the cross-object field thing working...
Will post with results of the VF attempt.
The VF worked, stumbled across the "escape=true" issue posted about here: http://boards.developerforce.com/t5/Visualforce-Development/Rich-Text-Area-fields-do-not-display-correctly-in-Visualforce/m-p/184507
Other than that this was a pretty quick work-around.
Hope that helps!