Skip to main content
I'm trying to query all related record in a child list from opportunity object, but I've not achieved this:

Parent Object: Opportunity

Child Object: Opportunity_Product__c (Custom Object)

Fields: Product_Description1__c and Product_Dimension__c

Master-Detail(Opportunity): Opportunity__c

So far, I have:

Select Id, Name, 

(

Select Id, Opportunity__r.Opportunity__c, 

Opportunity__r.Product_Description1__c, 

Opportunity__r.Product_Dimesion__c 

from Opportunity_Product__c

from Opportunity where id =  '0061b000002DjSCAA0'

Any HELP, will appreciated... Thanks
11 answers
  1. Feb 10, 2016, 3:42 PM
    Sorry Bro, 

    You need to read the Relationship Queries - 

    Try this one - 

    Select Id, Name, (Select Id, Product_Description1__c, Product_Dimesion__c from Opportunity_Products__r) from Opportunity where id =  '0061b000002DjSCAA0'

    Pls, let me know, if it solves your problem.

    Thanks, 

    Sumit Kumar Singh

     
0/9000