You need to sign in to do that
Don't have an account?

Apex:Repeat In Same Order As Related List In Page Layout
Hi,
So in my page layout, I have a related list (child object) that is sorted by "priority" variable. When I create a PDF VisualForce page, I use apex:repeat to loop through that relaled list and display all the records. It works fine and all, except the order of this apex:repeat is the order of when the record is creaed (not the order of priority). Is there a way I can use apex:repeat to have the same order as the page layout (sorted by Priority)? Can this be done without Apex (right now I just use a Standard Controller)? Thanks.
So in my page layout, I have a related list (child object) that is sorted by "priority" variable. When I create a PDF VisualForce page, I use apex:repeat to loop through that relaled list and display all the records. It works fine and all, except the order of this apex:repeat is the order of when the record is creaed (not the order of priority). Is there a way I can use apex:repeat to have the same order as the page layout (sorted by Priority)? Can this be done without Apex (right now I just use a Standard Controller)? Thanks.
Still if you don't want to use apex controller for sorting, then you can do it by javascript, check this link for the sorting child records in apex:repeat tag using javascript http://salesforce.stackexchange.com/questions/9091/sort-order-of-child-records-using-a-standard-controller
can you post your code?
In my apex I used this code: ORDER BY
from Linea_de_detalle__c Where OT__c = :this.ot.id ORDER BY Grupo__c]: