Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

In my email template, I am displaying entities in a association in table, doing the following:

<table border="0">

<tr>
    <th>Opportunity</th><th>Digest Note</th>
</tr>
    <apex:repeat var="fact" value="{!relatedTo.DM_Interesting_Facts__r}">
    <tr>
     <td>{!fact.Interesting_Fact__c}</td>
     </tr>
</apex:repeat>  
</table>

I want to

  1. Add order to the the table. So that the entities in the association are ordered by the value of a certain attribute?
  2. Filter values in the table. I only want to display entities when another attribute has a certain value.

Any tips?

share|improve this question

1 Answer 1

If you're using an email template you're out of luck with order.

If you use a visualforce page with a controller you can then get a list of your facts and order them with Apex before it's rendered.

share|improve this answer
    
I am in a visual force email template. Is there anyway to add order to such a table? –  dublintech Dec 19 '12 at 17:25
    
Try jquery plugin to see if sorting on client side works .Not a bad option .Since style sheets work should work on template as well –  Mohith Shrivastava Dec 19 '12 at 17:46
    
You would have to create a custom component for your email template and use the component controller to return an ordered list: salesforce.com/us/developer/docs/pages/Content/… –  Salesforce Wizard Dec 19 '12 at 17:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.