Conceptually, there is one Standard Pricebook and there are many custom Pricebooks. This allows you to do the following:
- For SKU xyz, the standard pricebook price could be $10.00
- For the same SKU xyz, on the pricebook called Commercial, the price is $10.00
- For the same SKU xyz, on the pricebook called US Government, the price is only $8.00
When you create a pricebookEntry for the junction between Product2 and Standard Pricebook, set useStandardPricebook
to false
. All pricebookEntries on standard Pricebook have useStandardPrice
= false
When you create a pricebookEntry for the junction between Product2 xyz and Pricebook US Government, set useStandardPricebook
to false
and set unitPrice to 8.00.
On custom pricebook called 'Commercial' where SKU xyz is $10.00, then when you create a pricebookEntry for the junction between Product2 xyz and Pricebook Commercial, set useStandardPricebook
to true
and set unitPrice to 10.00.
In effect, your updates to PricebookEntry are mimicing the SFDC Force.com user interface where you define standard pricebook prices for a Product and then, if you use custom pricebooks, you can choose to use the standard price or override the standard price, just for that pricebook.
Don't forget that all pricebook entries must be inserted against the Standard pricebook before you can insert pricebookEntries on custom pricebooks.
Best Answer
It is a pure business logic.
There are different pricebooks for same products. This is because you may have different type of customers for the same product.
One customer who purchase in bulk, for him you will have pricebook with some discount. Other customers who don't purchase in bulk you will have pricebook without discounts. There can be other scenarios that you have few loyal customers for whom you have completely different pricebook. So, keep these pricebooks private for individual customers (opportunity) Salesforce make them completely isolated and didn't provide any gap that these pricebook can be shared.
In an organisation there can be two different opportunities which have different deal for same product and for good relationship there price book must not be shared with each other anyhow otherwise this will have negative impact on trust and goodwill.