+ Start a Discussion

Trouble reading data from a custom object

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?

Hi SteveOrg93, can you please post the code which gives a better picture on what might be causing this error?
Thanks for the response: here is the query being run on our side that returns the error:

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