You need to sign in to do that
Don't have an account?
iyappan kandasamy 4
From child to parent soql query
From child-Parent soql
----------------------------
Parent = college
child =student(lookup with parent)
relation =Students
written query as
for(Student__c s:[select Name,college__r.Name,CollegeName__c from student__c])
{
system.debug('student Name:'+s.Name+' college Name:'+s.college__r.Name);
}
but error as
Line: 3, Column: 18
select Name,college__r.Name,CollegeName__c from ^ ERROR at Row:1:Column:13 Didn't understand relationship 'college__r'
----------------------------
Parent = college
child =student(lookup with parent)
relation =Students
written query as
for(Student__c s:[select Name,college__r.Name,CollegeName__c from student__c])
{
system.debug('student Name:'+s.Name+' college Name:'+s.college__r.Name);
}
but error as
Line: 3, Column: 18
select Name,college__r.Name,CollegeName__c from ^ ERROR at Row:1:Column:13 Didn't understand relationship 'college__r'
for(Student__c s:[select Name,collegeName__r.Name,CollegeName__c from student__c])
{
system.debug('student Name:'+s.Name+' college Name:'+s.collegeName__r.Name);
}
Let us know if this will help you.
Issue was your API name.
All Answers
--
Thanks,
Prashant
--
Thanks,
Prashant
for(Student__c s:[select Name,collegeName__r.Name,CollegeName__c from student__c])
{
system.debug('student Name:'+s.Name+' college Name:'+s.collegeName__r.Name);
}
Let us know if this will help you.
Issue was your API name.