+ Start a Discussion

Sorting A Class list....

I have the following class:


    Public Class Ahrec
        Date ActivityDate{get; set;}
        String Client{get; set;}
        String Subject {get; set;}
        String Descrip  {get; set;}
        String Status {get; set;}
        Boolean isClosed {get; set;}
        Integer Ctr {get; set;}
        Id AccountId {get; set;}
        Id TaskId {get; set;}

    I then create a list called lstAhrecs of this classs


    List<Ahrec> lstAhrecs = new List<Ahrec>()


   My class list then gets populated from a SOQL query.


   What I want to do now is SORT the class list by ActivityDate DESCENDING.


   Can anyone show me code on how to do this?

   Thanks so much in advance!




and load the list from a SOQL query...


   What I would now like to do is SORT the list by ActivityDate in a descending order.


   List<Ahrec> mylist