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
Rahul AlladaRahul Allada 

To query Opportunity Product using Quote line item Id

Hello Trailblazers,

I have a requirement and i am pretty much confused. Let me explain the issue in which i am confused.

I have a Quote Line Item ID(QLI ID). And with this ID i want to retrieve opportunity product records in that QLI.How do i write that query?

ShirishaShirisha (Salesforce Developers) 
Hi Rahul,

Greetings!

Can you please try the below sample query:

SELECT Name,Quantity, UnitPrice, TotalPrice,PricebookEntry.Name, PricebookEntry.Product2.Family FROM OpportunityLineItem WHERE OpportunityId = :oppName.Id

Reference:https://trailblazers.salesforce.com/answers?id=9063A000000Dy5AQAS

Kindly mark it as best answer if it helps so that it can help others in the future.

Warm Regards,
Shirisha Pathuri