[SalesForce] Didn’t understand relationship ‘opportunity__c’ in field path

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."

Best Answer

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 
Related Topic