function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
vishesh91vishesh91 

opportunity product list

how can I get opportunity product list programatically for an opportunity

Please help

Best Answer chosen by Admin (Salesforce Developers) 
sfdcfoxsfdcfox
SELECT Id,OpportunityId,PricebookEntryId,UnitPrice,Quantity,Discount,Description FROM OpportunityLineItem WHERE OpportunityId = :opportunity.id

There are other fields available, too, so check the WSDL for your organization or the Web Services API Developer's Guide.