List <EmailMessage> sortedEmails = new List<EmailMessage>(); sortedEmails = [SELECT Id, FromAddress, ToAddress, BCCAddress, MessageDate, Subject, HasAttachment, Incoming, TextBody, CreatedBy.Name from EmailMessage where ParentId =: currentCase.Id order by MessageDate DESC ];
List<CaseComment> Casecomments = new List<CaseComment>(); Casecomments = [SELECT Id, CommentBody, CreatedDate, ParentId FROM CaseComment where ParentId =: currentCase.Id order by CreatedDate DESC];
The above queries are working well to show CaseComments and Emails (Case Related list) in different sections in VF page.
I would like to show them in a single section by combining Emails and comments in
order by date. How can this be accomplished?