I have a SalesForce custom object named
Loan__c which has a Lookup field called
LoanLead__c and I'm trying to query that relationship with SOQL but I'm getting an error when I run the query
SELECT Id, (SELECT Id FROM LoanLeads__r) FROM Loan__c on the object in the developer console query editor.
I've confirmed the Object API name of the related
LoanLeads table is indeed
LoanLead__c and I have tried modifying the query to select from the
LoanLead__r table and a few others, but I get the same error.
The error I'm getting is:
SELECT Id, (SELECT Id FROM LoanLeads__r) FROM Loan__c
ERROR at Row:1:Column:28
Didn't understand relationship 'LoanLeads__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 can't figure out what I'm doing wrong - everything I've read says this should work and it does work with other lookup fields on this same table. Any help would be greatly appreciated.