I have a custom field within Opportunity called customer_rep__c which is lookup on Users. I am now querying a bunch of columns from opportunity and the name associated to the customer_rep__c. I have tried a number of different select statements and I keep getting:

ERROR at Row:1:Column:222

Didn't understand relationship 'User__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.

How would I get the Customer_Rep's name?

1 Answer 1


it is customer_rep__r.FIELD (customer_rep__r.Name)

you need to use Relationship name, not the object you are referring to

refer to this if you want to know more: https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_relationships_and_custom_objects.htm

You must log in to answer this question.

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