How can I use the salesforce api to get a list of opportunities such that each opportunity contains it's opportunity line items?

1 Answer 1


Well the SOQL it would be something like this-

[Select Id, (Select Id From OpportunityLineItems) From Opportunity]

Once you get that, you would have to loop through a list of items under each Opportunity record. Hope this answers your question.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .