You need to sign in to do that
Don't have an account?

Visualforce Email Template Merging Related Object Field
Hi all,
I have a visualforce email template related to one object, Events. Related to Events is an object called Teams. I'm trying to get a field from the Teams object into the template. How do I call this field?
Code:
<messaging:emailTemplate subject="PREFERRED TRAVEL NEEDED || {!relatedTo.Events__r.Name}" recipientType="User" relatedToType="Teams__c">
<messaging:htmlEmailBody >
<apex:outputLink value="http://smt.force.com/?#/details/{!relatedTo.Events__r.Id}">Submit Travel for {!relatedTo.Engineer__r.Name}</apex:outputLink> <br/> <br/>
<b>Event: </b>{!relatedTo.Events__r.Name} <br/>
<b>Account: </b>{!relatedTo.Events__r.accountLookup__c}<br/>
I'd like to call this other field right below Account.
I have a visualforce email template related to one object, Events. Related to Events is an object called Teams. I'm trying to get a field from the Teams object into the template. How do I call this field?
Code:
<messaging:emailTemplate subject="PREFERRED TRAVEL NEEDED || {!relatedTo.Events__r.Name}" recipientType="User" relatedToType="Teams__c">
<messaging:htmlEmailBody >
<apex:outputLink value="http://smt.force.com/?#/details/{!relatedTo.Events__r.Id}">Submit Travel for {!relatedTo.Engineer__r.Name}</apex:outputLink> <br/> <br/>
<b>Event: </b>{!relatedTo.Events__r.Name} <br/>
<b>Account: </b>{!relatedTo.Events__r.accountLookup__c}<br/>
I'd like to call this other field right below Account.