I am trying to query emails that are related to a contact. I am trying to do it this way:

SELECT Id, (SELECT Id FROM Emails) FROM Contact WHERE Id = '0033H000005dzR2QAI' 

but I am getting en error: "Didn't understand relationship 'Emails' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names."

1 Answer 1


It appears that the relationship name Emails is correct. If you try to run this query against an Account, Opportunity, Order, Product2, or Asset, it works just fine.

Contact is the only object I've tried that I've ran into an issue with.

Since you have a specific Contact Id, simply querying the EmailMessages object instead should work. (SELECT Id FROM EmailMessage WHERE RelatedToId = '0033H000005dzR2QAI')

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .