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
Chermadurai BalaChermadurai Bala 

Need to Access Object "EmailStatus"

When query EmailStatus objects, getting Error as like this "entity type EmailStatus does not support query"

Is it possible to retrieve data from this object?

Please advice!
Best Answer chosen by Chermadurai Bala
JyothsnaJyothsna (Salesforce Developers) 
Hi Bala,

You cannot query the object directly but you could query the parent of the EmailStatus, for example the contact and it's children records and filter it by account:
 
list<schema.contact>clst=[Select Name, AccountId, (Select Id, EmailTemplateName From EmailStatuses) From Contact WHERE AccountId ='0019000001fuFdm'];
system.debug(clst);
HTML Email Status Related list is available only for Leads, Contacts and Person Accounts which has the standard email field.

Hope this helps you!
Best Regards,
Jyothsna
 

All Answers

JyothsnaJyothsna (Salesforce Developers) 
Hi Bala,

You cannot query the object directly but you could query the parent of the EmailStatus, for example the contact and it's children records and filter it by account:
 
list<schema.contact>clst=[Select Name, AccountId, (Select Id, EmailTemplateName From EmailStatuses) From Contact WHERE AccountId ='0019000001fuFdm'];
system.debug(clst);
HTML Email Status Related list is available only for Leads, Contacts and Person Accounts which has the standard email field.

Hope this helps you!
Best Regards,
Jyothsna
 
This was selected as the best answer
Chermadurai BalaChermadurai Bala
THank you Jyothsna.