You need to sign in to do that
Don't have an account?
ajay ambati
soql not retriving record from parent object
1,hi,iam having two objects oppurtunity(parent) and another is custom object name is TopXDesignation__c(child) having MDR RELATIONSHIP and i want to retrieve records from parent i,e opportunity so, i wriiten soql query below
lstopp=[select id,Name,CloseDate,StageName,(select id,name,Document_Attached__c from TopXDesignation__r) from Opportunity];
but iam getting below error:
Didn't understand relationship 'aTopXDesignation__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.
2,and also iam tried follwing type query not geeting
lstopp=[select id,Name,CloseDate,StageName,(select id,TopXDesignation__c.name,TopXDesignation__c.Document_Attached__c from TopXDesignation__c.TopXDesignation__r) from Opportunity];
ERROR IS :
TopXDesignation__c.Document_Attached__c from TopXDesignation__c.TopXDesignation__r)
^
ERROR at Row:1:Column:116
Didn't understand relationship 'TopXDesignation__c' in field path. 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 ANSWER IT
lstopp=[select id,Name,CloseDate,StageName,(select id,name,Document_Attached__c from TopXDesignation__r) from Opportunity];
but iam getting below error:
Didn't understand relationship 'aTopXDesignation__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.
2,and also iam tried follwing type query not geeting
lstopp=[select id,Name,CloseDate,StageName,(select id,TopXDesignation__c.name,TopXDesignation__c.Document_Attached__c from TopXDesignation__c.TopXDesignation__r) from Opportunity];
ERROR IS :
TopXDesignation__c.Document_Attached__c from TopXDesignation__c.TopXDesignation__r)
^
ERROR at Row:1:Column:116
Didn't understand relationship 'TopXDesignation__c' in field path. 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 ANSWER IT
You might need to check the child relationship name. This can be found in the opportunity lookup field under Master-Detail options for the TopXDesignation object. Chances are the child relationship name is the issue. When you find it simply append the __r and do something like this
Hope this helps!
AM
1,lstopp = [SELECT Id, Name, CloseDate, StageName, (SELECT Id, Name, Document_Attached__c FROM Opportunitys__r) FROM Opportunity];
2,,lstopp = [SELECT Id, Name, CloseDate, StageName, (SELECT Id, Name, Document_Attached__c FROM TopXDesignation__r) FROM Opportunity];
still iam not getting error not solved