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
John DaJohn Da 

Apex:Repeat In Same Order As Related List In Page Layout


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.
Currently there is no standard attribute in repeat tag for the sorting. Vote for this Idea -

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
David OvellaDavid Ovella

can you post your code?

In my apex I used this code: ORDER BY

 from Linea_de_detalle__c Where OT__c = ORDER BY Grupo__c]: