I need to report on pricebook in order to have all products with their price on the pricebook? Any lead about that?
2 Answers
You can use SOQL and VLookup to get your answer.
- Go to workbench.developerforce.com and login to salesforce production environment.
- For the "Jump To" field select SOQL. For the object choose Pricebook Entry.
In the "Enter or modify a SOQL query below:" field enter the following:
SELECT Id,IsActive,IsDeleted,Name,Pricebook2Id,Product2Id,ProductCode,UnitPrice FROM PricebookEntry WHERE IsActive=True
Choose the Bulk CSV option in the "View As" field and click on the "Query" button.
- Once the status is "Completed", click on the small silver icon with a blue arrow to download and open in MS Excel.
- Go back to workbench and create another SOQL query. Choose the Pricebook2 object this time.
In the "Enter or modify a SOQL query below:" field enter the following:
SELECT Description,Id,IsActive,IsDeleted,Name FROM Pricebook2 WHERE IsActive=True
Choose the Bulk CSV option in the "View As" field and click on the "Query" button.
- Once the status is "Completed", click on the small silver icon with a blue arrow to download and open in MS Excel.
- In Excel do a VLookup between the Pricebook2Id column of the PricebookEntry table and the Id column of the Pricebook2 table to return the name of the Pricebook on the PricebookEntry table and that will give you every active product and the pricebook that they are in.
-
I resolve the problem the way you describe it but using data loader instead of workbench. And have to Vlookup manually the two file resulting (Products and PriceBookEntry)– LoveLaceCommented May 13, 2015 at 14:54
-
I'm glad I could help. Could you mark my answer as the best choice then? Commented May 14, 2015 at 3:25
As far as my knowledge goes, PriceBook is not exposed to reports. So you can't make use of this in Reporting.
Alternatives will be to create a SOQL query and use that to manually create a report in a Visualforce page or else export the data in MS Excel and then manipulate it accordingly.