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
rajesh_yrajesh_y 

need help in query

Hi All

I three custom objects those are Community_Member__c,question__c.answer__c

 when i tried the following query

Community_Member__c c=[select name,(select header__c from question__r ) from Community_Member__c ];

its giving following error

Compile Error: line 1, column 23: Didn't understand relationship 'question__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.

here paren is Community_Member__c 

child is question__c

 

 

please help why i am getting error

 

 

 

thank you in advance

 

 

rajesh

Best Answer chosen by Admin (Salesforce Developers) 
Bhawani SharmaBhawani Sharma

Community_Member__c c=[select name,(select header__c from question__r ) from Community_Member__c ];

instead of using the relationshipship name "question__r", you should use the child relationship name.

May be you can try this :

 

Community_Member__c c=[select name,(select header__c from questions__r ) from Community_Member__c ];

if this doesn't work , then :

replace "questions__r" with child relationship name.

All Answers

Bhawani SharmaBhawani Sharma

Community_Member__c c=[select name,(select header__c from question__r ) from Community_Member__c ];

instead of using the relationshipship name "question__r", you should use the child relationship name.

May be you can try this :

 

Community_Member__c c=[select name,(select header__c from questions__r ) from Community_Member__c ];

if this doesn't work , then :

replace "questions__r" with child relationship name.

This was selected as the best answer
Ankit AroraAnkit Arora

Yes, you need to use the relationship name of the child. Just click on the field(Lookup) and check out the relationship name and use it in your inner query.

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

rajesh_yrajesh_y

thank you very much for your help

Nishad BashaNishad Basha
Compile Error: Didn't understand relationship 'AdminAccounts__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
iam getting this error plz how to solve the solution