You need to sign in to do that
Don't have an account?
![AMIT KUMAR 73 AMIT KUMAR 73](https://dfc-org-production.my.site.com/img/userprofile/default_profile_45_v2.png)
SOQL Query to Retrieve Price Book Name for a associated product
Hi,
I am trying to retrieve Product Name, Product code & Pricebook Name associated with a PRODUCT.
--------------------------------------------------------------------------------------------------------------------------------------------------------
Product2 productdet = [Select Id, Name, ProductCode From Product2 where id='01tA00000033x2z'];
--------------------------------------------------------------------------------------------------------------------------------------------------------
How to modify this query to associate PriceBook details this Product belongs to.
![Product](/forums/servlet/rtaImage?eid=906F0000000Akt0&feoid=Body&refid=0EMF0000000QWcS)
I am trying to retrieve Product Name, Product code & Pricebook Name associated with a PRODUCT.
--------------------------------------------------------------------------------------------------------------------------------------------------------
Product2 productdet = [Select Id, Name, ProductCode From Product2 where id='01tA00000033x2z'];
--------------------------------------------------------------------------------------------------------------------------------------------------------
How to modify this query to associate PriceBook details this Product belongs to.
If there are multiple product price book entry need to be mapped then you have to create a map
SELECT Name, Product2.Name, Product2.ProductCode, PriceBook2.Name from PriceBookEntry where Product2.Name = 'whatever'