You need to sign in to do that
Don't have an account?

SOQL on Master-Detail Relationships
Hello,
I am a novice in writing SOQL statements concerning Master Detail relationships. I would like to know how I need to write a SELECT SOQL statement on these:
Master object: Opportunity
Detail object: Quote
Child Relationship Name: Quotes
Field Name: Opportunity
Basically, I want to extract the Id from Opportunity and add it to the other fields of the Quote object in a single SELECT SOQL statement. How do I proceed?
Regards,
Vijay.
If you want to use inner query then this is what you should use...
Thanks
All Answers
Maybe try this?
SELECT Opportunity__R.id, Name FROM Quote
This works is my system
SELECT Order_Header__R.Last_Invoice_Date__C, Description__c
FROM Order_Detail__C
Order_Header__C is parent, Order_Detail__C is child in my system.
Aron
Hello,
Thanks for your help, but in both cases, I am getting the error:
Didn't understand relationship... 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.
Kind Regards,
Vijay.
Let me know if you got the solution or not so we can help..
Thanks,
Sandeep
Hello Sandeep,
I have not got any solution yet. I still need help.
Regards,
Vijay
If you want to use inner query then this is what you should use...
Thanks
Thanks Sandeep!
It works fine now.
Regards,
Vijay.
Vijay Birsingh
I would like to know how to do a Master-detail Soql query please I'm a beginner
Regards