Activity Forums Salesforce® Discussions How to query Products by Opportunity?

  • Manpreet

    Member
    April 26, 2017 at 1:30 pm

    Hi Suraj,
    You can use OpportunityLineItem to traverse from Opportunity to PricebookEntry and Product..

    something like this query :

    SELECT Id, Name, Account.Name, (SELECT Quantity, UnitPrice, TotalPrice, PricebookEntry.Name, PricebookEntry.Product2.Family FROM OpportunityLineItems) FROM Opportunity WHERE Id = :YourOppId

    Thanks.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos