You need to sign in to do that
Don't have an account?
Vijay sidaraddi
SOQL query for parent child relation getting error
HI Friends,
im trying to get the records for nested query in developer, i couldn ot able to do it can some one suggest me where im wrong
SELECT ENQ_Project_Name__c,ENQ_AFE__c,ENQ_Inspection_Level__c,
ENQ_Status__c,ENQ_Surveillance_Discipline__c,ENQ_Other__c,
(SELECT ENQ_QSC__c,ENQ_QSC_Contact__c FROM ENQ_Surveillance_Reports__c)
FROM ENQ_Assignment_Package__c
Error message :
ENQ_QSC__c,ENQ_QSC_Contact__c FROM ENQ_Surveillance_Reports__c)
^
ERROR at Row:3:Column:69
Didn't understand relationship 'ENQ_Surveillance_Reports__c' 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.
Thanks
Vijaykumar
im trying to get the records for nested query in developer, i couldn ot able to do it can some one suggest me where im wrong
SELECT ENQ_Project_Name__c,ENQ_AFE__c,ENQ_Inspection_Level__c,
ENQ_Status__c,ENQ_Surveillance_Discipline__c,ENQ_Other__c,
(SELECT ENQ_QSC__c,ENQ_QSC_Contact__c FROM ENQ_Surveillance_Reports__c)
FROM ENQ_Assignment_Package__c
Error message :
ENQ_QSC__c,ENQ_QSC_Contact__c FROM ENQ_Surveillance_Reports__c)
^
ERROR at Row:3:Column:69
Didn't understand relationship 'ENQ_Surveillance_Reports__c' 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.
Thanks
Vijaykumar
When using Sub-query you need to use child relationship name and if child is a custom object you need to append '__r' after the child relationship name.
So try this :
Please mark this question as Solved if this helps you, so that others can view it as a proper solution.
Thanks,
Apoorv
u did small mistack i .e ENQ_Surveillance_Reports__c
try this. ENQ_Surveillance_Reports__r
becz of they have a realtionship(parent to child)
so we keep it as r in c