In a Salesforce Apex class how can we sort a list of custom objects by multiple fields asc or desc? I have a need to sort based on certain conditions from within an apex trigger. I cannot re-query the data to sort using a soql query because it hits a query limit.
I know half the answer to this question. Create a wrapper class
http://salesforce.stackexchange.com/questions/8370/how-to-sort-wrapper-list . Just have to figure out how to do it for multiple fields. Also, I’m hoping there is an easier way.