+ Start a Discussion

Who.Something does not work in my SOQL???


   My query does not work:


SELECT Id, ActivityDate, Status, Who.MailingCity, Who.MailingState, Who.Email FROM Task

 What is wrong with it? Please advise...

I am guessing Who.MailingCity and Who.MailingState but Why???



"Who" can refer to either a contact or a lead.     Mailing address fields are applicable only for contact.  That's probably why you are seeing this error.


Way absolutely gm_sfdc_powerde, who refers to contact or lead only not any of the belonging fields. U should use whoid in the context of lead or contact. 









dotnet developedotnet develope

Hi Friend,


By seeing your SOQL query, i have some concerns in my mind.


1) In that query which object is primary(Master) and Secondary(Child)?


when you are writing a query on relationship between objects you should have an idea that on Master query you can define child and as sub query.


please find the link related to this.