+ Start a Discussion

EmailMessages SOQL

How to write soql for retrieving records from EmailMessages.


I am using:


List<EmailMessages> emailMessage = [Select Id, ParentId, ActivityId,TextBody, HtmlBody, Headers, Subject, FromName, FromAddress, ToAddress, CcAddress, BccAddress, Incoming, HasAttachment, Status, MessageDate, IsDeleted, ReplyToEmailMessageId From EmailMessages where Status = '3' and ActivityId in :activityId];



Error : sObject type EmailMessages is not supported...


Any help on this please?


Unfortunaltely we can not write SOQL on emailMesage object direclty I think API name should be anything else let me search becaue we can apply query call on this object ( suggested by Salesforce)


Thanks Sandeep.


Waiting for your response.