You need to sign in to do that
Don't have an account?
Vigneshwaran Loganathan
didn't understand the relationship
Hi.
I have two custom objects Our_va__c and Cancellation__c. cancellation has Lookup to Our VA.
I need to fetch all cancellation records for the purticular Our va. I have written query like..
I got the error didn't Understand the relationship...
Anyone help plz??
I have two custom objects Our_va__c and Cancellation__c. cancellation has Lookup to Our VA.
I need to fetch all cancellation records for the purticular Our va. I have written query like..
///***** Cosider All our_va__c ids are in Ovaids List<our__va__c> ova= new list<our_va__c>(); ova=[select id,name, (select name from cancellation__r) from our_va__c where id IN : Ovaids]
I got the error didn't Understand the relationship...
Anyone help plz??
use cancellations__r instead if cancellation__r inside the inner query
or do something like this.
list<child__c> childList = [select id from child__c where id where Id =: parentId];
Thanks,
Vijay
All Answers
You have look of Cancellation__c on Our VA then Our VA will have only on Cancellation__c associated with it.
Query should be looks like below.
Please let me know if it helps you.
Best Regards,
-Vivek
use cancellations__r instead if cancellation__r inside the inner query
or do something like this.
list<child__c> childList = [select id from child__c where id where Id =: parentId];
Thanks,
Vijay
See links below for detail and samples
__r represents a custom relationship. There are two uses for __r. We use it when we query a custom relationship from child to parent, or from parent to child.
Please check below post for more example
http://salesforce.stackexchange.com/questions/28708/difference-between-c-and-r
UNDERSTANDING RELATIONSHIPS IN SALESFORCE
http://www.forcetree.com/2009/07/understanding-relationships-in.html
Please check below blog with screen shot. I hope that will help u
http://11concepts.com/sfdc/blog/understanding-__c-and-__r/
Please let us know if this will help you
Thanks
Amit Chaudhary