0

I'm trying to pull the Contact field by Account name and I'm sure the way I'm doing must not be the right way.

my SOQL:

Select AccountId,Id,FirstName,LastName,Email,Phone 
from Contact where Account__r.Name='BMW'

ERROR at Row:1:Column:71 Didn't understand relationship 'Account__r' in field path. 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.

4

Account is not a custom object, therefore your relationship name should be just 'Account'

Select AccountId,Id,FirstName,LastName,Email,Phone 
from Contact where Account.Name='BMW'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.