function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
moverdorfmoverdorf 

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

 

 

Starz26Starz26