I have two standard objects (Case & EmailMessage) where EmailMessage has a lookup field to Case.

I'm using a simple SOQL query to get EmailMessage fields along with Case Status, but it is throwing and error.

This is the query:

SELECT Subject, Case.Status FROM EmailMessage LIMIT 50

This is the error: enter image description here

Anyone know what is causing the error please?

Thank you

1 Answer 1


The relationship from EmailMessage to Case is called ParentId. See the Object Reference for Case

so your SOQL should be

SELECT Subject, Parent.Status FROM EmailMessage Limit 50
  • It is good now, thank you Commented May 27 at 19:17

You must log in to answer this question.

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