function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Visualforce email template On Account displaying all opportunities

Hi everyone,


I am looking for a Visualforce email template to be placed on Account level for displaying all opportunities.


If anyone has a code to share, it will be appreciated in advance.


Thank you in advance.


I think something like this should work. I threw this together in notepad so there may be some syntax errors.

<messaging:emailTemplate subject="Account w/ Opps" recipientType="User" relatedToType="Account"> <messaging:htmlEmailBody > <apex:dataTable value="{!relatedTo.Opportunities}" var="o"> <apex:column value="{!o.Name}"/> <apex:column value="{!o.CloseDate}"/> </apex:dataTable> </messaging:htmlEmailBody> </messaging:emailTemplate>




This is great TehNrd!! wonderful - is there a way to add amount and filter only open opportunities?


Appreciated !!


You could try something like this:



<apex:dataTable value="{!relatedTo.Opportunities}" var="o"> <apex:column value="{!o.Name}" rendered="{!o.IsClosed == false}"/> <apex:column value="{!o.CloseDate}" rendered="{!o.IsClosed == false}"/> </apex:dataTable>