You need to sign in to do that
Don't have an account?
Eric.Goehring.ax954
Visualforce Email Template
Gang,
Let me know if you can help. I created a very simple Visualforce Email Template with a list of related records using the repeat function. Problem is they are out of order, they are even out of their created Id order? strange.
How can I get this resolved, write a controller? Can you point me in the right direction?
Thanks
Related list records should are displayed based on created date. well you could write simple controller in your VF Template to sort them with any other field.
So what might a simple controller look like?
I need to sort by the Publication Date:
<apex:repeat var="cx" value="{!relatedTo.Schedules__r}">
<tr><td width="25%">{!month(cx.Publication_Date__c)}/{!day(cx.Publication_Date__c)}/{!year(cx.Publication_Date__c)}</td><td width="25%">{!round(cx.Ad_Discount_Pct__c,0)}%</td><td width="25%"> </td><td width="25%"> </td></tr>
</apex:repeat>
Check out Visualforce guide. in Visualforce mail template --> Using Custom Controllers within Visualforce Email Templates.