Saturday 24 March 2012

Loading Products and Price Book Entries

Product2:
Represents a product that your organization sells.

Pricebook2:
Represents a price book that contains the list of products that your organization sells
There are actually two Pricebook categories. One is Standard Pricebook and other is Custom Pricebook.
There may be more than one Custom Pricebook in an organization but only one Standard Pricebook.
In order to make a Product available for a Custom Pricebook(i.e. resulting PricebookEntry), the following conditions must be satisfied 
1. The Product must be in Standard Pricebook
2. The Product must be active in Standard Pricebook

PricebookEntry:
Represents a product entry (an association between a Pricebook2 and Product2) in a price book. PricebookEntry is actually a junction object between Product2 and Pricebook2 objects. Hence, it has two standard fields namely Product2Id and Pricebook2Id.

Loading Products:
 Load file must contain,
1. Name    
2. IsActive and other fields as needed by your application.

Loading PricebookEntries into Standard Pricebook:
Load file must contain, 
1. product2Id (use the Id's from the success log file of Product Insert Load)
2. pricebook2Id (get it by either from application/by Querying for Standard Pricebook)
3. UnitPrice
4. UseStandardPrice (True/False)
5. IsActive (True/False)
6. Currency ISO Code
7. other fields as per your application.






Loading PricebookEntries into Custom Pricebook:
Load file must contain
1. product2Id (use the Id's from the success log file of Product Insert Load)
2. pricebook2Id (get it by either from application/by Querying for Custom Pricebook)
3. UnitPrice
4. UseStandardPrice (True/False)
5. IsActive (True/False)
6. Currency ISO Code
7. other fields as per your application.

If Multi-Currency is enabled for your organization, then you are supposed to load one PriceBookEntry for each currency. Hence if you have "M" currencies in your organization and "M" new PricebookEntries are to be added..then a total of M*N entries need to be made.