Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

<table border="0">

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

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

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 Wizard Dec 19 '12 at 17:57

Your Answer


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.