You need to sign in to do that
Don't have an account?
Deepu161
need to display list based on the desc order of dates
SELECT Id, Name, Project__c, Employee__c, Client_Pay__c, Client_Pay_Per_Day__c, Hours__c, Date_Of_Service__c, Invoice__c FROM Timecard__c WHERE Employee__c IN :empids AND project__c = :objInvoices.Project__c AND Date_Of_Service__c >= :objInvoices.Service_Term_From__c AND Date_Of_Service__c <= :objInvoices.Service_Term_To__c order by Date_Of_Service__c desc ];
If so, you can do the following.
1. Read the Results into list
2. Load them into a Map (with Date as the Key)
3. Sort the values in the Map
4. Covnert the map values into List (used Values method)
Note : if there are more than one records for the same date, try to come up with some logic to build the key such that all records can be loaded into the Map.
All other data types are supported, with the following caveats:
Corporate currency always sorts using corporate currency value, if available.
phone data does not include any special formatting when sorting, for example, non-numeric characters such as dash or parentheses are included in the sorting.
picklist sorting is defined by the picklist sort determined during setup.
Hope it will help you.
Best,
Huang https://randsfdc.blogspot.com