+ Start a Discussion

Trouble returning custom object fields on a contact

Hi there, I'm hoping someone here can help understand why we are having trouble reading data from a master detail custom object.

We have a custom object that is a master detail relationship to the contact.  Upon fetching the custom object fields (custom_object__r) along with the Saleforce contact fields, Salesforce is returning back the following error:

Didn't understand relationship 'custom_object__r' in FROM part of query call. 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.

I looked around through other threads that mentioned I might need to replace custom_object__r with the ObjectID, however that doesn't change the error message returning back.  

Is there a proper way to return custom object data upon returning contact information?

Here is the query: 
SELECT Name, Account.Name, Title, Email, AccountId, Id, (SELECT custom_field__c FROM Custom_Object__r) FROM Contact WHERE Email = 'name@http://example.com'

Best Answer chosen by SteveOrg93
As you already tried the 18digitcharacter id and it did not work. The only solution I can think of would be the one explained in the below post 


Please mark this as the best answer if it resolved your issue.