You need to sign in to do that
Don't have an account?
Related list and objects for Visualforce Email Templates
Hi,
I'm working on a VF email template and trying to output a couple related objects.
I want the recipient to be a Contact and I want to output variables from a "Buyer_Listing__c", and "Business_c" object, both of which are related lists for contact via a lookup field.
I also want to output a "Buyer_Listing_Categories__c" object that is master-detail with "Buyer_Listing__c" of that contact. Does anyone know how to accomplish this?
I looked around and found some suggestions but haven't gotten it to work:
-------------
<messaging:emailTemplate recipientType="Contact"
subject="Test"
relatedToType="Contact"
replyTo="support@acme.com">
<messaging:htmlEmailBody >
<html>
<body>
<apex:repeat var="cy" value="{!relatedTo.Buyer_Listing__r}">
<p>Asking Price: ${!cy.Listing_Price__c}.</p>
</apex:repeat>
<p><u>Business Identity and Location</u></p>
<p>{!cy.Listed_Business__c}.</p>
</apex:repeat>
Using apex:repeat seems like a really rough workaround, the other option is to change relatedToType = "Buyer_Listing_Categories__c", but then I can't find a way to get the "Business__c" object data.