Select id, Account.Type from opportunity__c

I create a custom object opportunity and make relational on Account__c and account data type lookup but above query does not run and give below error

"Select id, Account.Type from opportunity__c ^ ERROR at Row:1:Column:12 Didn't understand relationship 'Account' 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."

1 Answer 1


If you made this custom object then the field for account is also custom so the query should be like this:

Select id, Account__r.Type from opportunity__c 

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.