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
Jyotirmoy BJyotirmoy B 

Didn't understand relationship

I am writing a nested query in apex code but throwing error as Didn't understand relationship

Select Id,Name,MedConnect__Account_Name__c,(select Unity_Product_Code__c from Impacted_Products__r limit 1 ) from MedConnect__Product_Complaint__c limit 10  
                         
ParentObject- MedConnect__Product_Complaint__c
Child Object-   MedConnect__Impacted_Product__c
                     
Child Relationship Name     - Impacted_Products

could any one please tell me, if the query is wrong
Best Answer chosen by Jyotirmoy B
AngrySlothAngrySloth
I think you need to add the name space ( MedConnect__ ) to the child query object.

Select Id,Name,MedConnect__Account_Name__c,(select Unity_Product_Code__c from MedConnect__Impacted_Products__r limit 1 ) from MedConnect__Product_Complaint__c limit 10

All Answers

AngrySlothAngrySloth
I think you need to add the name space ( MedConnect__ ) to the child query object.

Select Id,Name,MedConnect__Account_Name__c,(select Unity_Product_Code__c from MedConnect__Impacted_Products__r limit 1 ) from MedConnect__Product_Complaint__c limit 10
This was selected as the best answer
Jyotirmoy BJyotirmoy B
Thanks @AngrySloth.It's working