function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SteveOrg93SteveOrg93 

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
Ramu_SFDCRamu_SFDC
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 

https://developer.salesforce.com/forums?id=906F00000008q63IAA

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