+ Start a Discussion
SFDC Forum 007SFDC Forum 007 

hi Apex order by issue



 I have a pdf report where i display all the detials of callreport , but the recently created callreport are gettting displayed at the bottom below to the callreport created previously in decending order, I want the newly created callreport to be displayed at the top



Hw do i do this , should i use ny order by class in my controller


Please help me


Yes you can use the ORDER By in your controller to control the display list.

Madhan Raja MMadhan Raja M

Use "ORDER BY CreatedDate DESC" in your SOQL statement.


For more details:- http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_soql_select.htm


Madhan Raja M