2

I want to get the product information using Opportunity line Item.What is the simplest way to query this?

Thanks very much.

1 Answer 1

7

SOQL allows you to traverse object relationships using dot notation, so for example to get to the Product (and its fields) via the Pricebook on the OpportunityLine you can do this...

Select PricebookEntry.Product2.Name From OpportunityLineItem

Then in Apex use the same path to access the field you need.

String productName = queriedOppLine.Product2.Name;

You must log in to answer this question.

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