I am unable to understand relationships with DML/SOQL.
Example, I have custom objects Course__c
and Course_line_item__c
. Course_line_item__c
has a lookup field on it that points to Course__c
. So this means multiple Course_line_item__c
's can have the same parent Course__c
, correct?
So I have this SOQL Query :
list<Course__c> LC=[SELECT Id, (SELECT Id FROM Course_line_item__c) FROM Course__c];
and I'm getting this lovely error :
Compile Error: Didn't understand relationship 'Course_line_item__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. at line 13 column 12
What am I doing wrong???
EDIT : me custom relationship field is called CourseLU__c
.
[SELECT Id, (SELECT Id FROM CourseLU__c) FROM Course__c]
?CourseLU__c
is the name of the custom lookup relationship field on the line item toCourse__c
. Crossing my fingers. EDIT : nope, I donot understand how to do this. – fraglord Jul 22 '16 at 11:33