You need to sign in to do that
Don't have an account?
SFDC AVINASH
SOQL on related objects.
Hi all,
I am having a problem with bellow SOQL.
SELECT Name, (SELECT Name FROM Resource__r) FROM Projects__c
My Resource__c object has a lookup field for Projects__c. When i try to execute the Query it will throw me an error informing
"ERROR at Row:1:Column:36
Didn't understand relationship 'Resource__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."
Please help me to resolve this. Also any material to understand the Related objects SOQL will be greately helpful for me to enhance my knowledge.
Thanks in advance.
I am having a problem with bellow SOQL.
SELECT Name, (SELECT Name FROM Resource__r) FROM Projects__c
My Resource__c object has a lookup field for Projects__c. When i try to execute the Query it will throw me an error informing
"ERROR at Row:1:Column:36
Didn't understand relationship 'Resource__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."
Please help me to resolve this. Also any material to understand the Related objects SOQL will be greately helpful for me to enhance my knowledge.
Thanks in advance.
SELECT Name, (SELECT Name FROM Resources__r) FROM Projects__c
basically you have to
1) Go to the relation ship field on the child object(Resource__c )
2) Click to View. and look at the attribute Child Relationship Name
you have to use (SELECT Name FROM <Child Relationship Name>__r in your Parent to Child Relation Ship query
The link below will help
http://www.salesforce.com/us/developer/docs/dbcom_soql_sosl/Content/sforce_api_calls_soql_relationships.htm
If you view the relationship field, it will have one of the attribute as Child Relationship Name