+ Start a Discussion

How to sort records selected from List View

When records are selected from a List View and passed to another page (e.g. via Mass Edit or Mass Update buttons) the records are not sorted in the new page (or perhaps are sorted by record Id?)


What is the best way to sort the records --- e.g., by Name --- before the new page is displayed?  I have created an extension, but cannot seem to get the records sorted before the page is displayed.


Any ideas?





If you're running a SOQL query in your extension, use the ORDER BY command.



Thanks...I did have the ORDER BY in my SOQL query, but had another problem which I corrected.