Sweet Potato

Categories
Blog

Maintaining Opportunity Price Integrity During Product Price Updates

Client Use Case

The requirement is to ensure that when we update the price of a product, the opportunity’s price should remain unaffected. Specifically, even if the Sales Price doesn’t change, any alteration in the List Price should not influence discounts for existing orders.

The issue arises because updating the List Price in a product’s price book entry also changes the List Price in the associated opportunity product. This leads to incorrect discount calculations, as illustrated below:

“When we update the price on a product we need to make sure the opportunity doesn’t also update. Even if it doesn’t update the Sales Price, if it changes the List Price it will then impact discounts and we do not want that to happen for old orders.”

That is “When the list price in this product’s price book entry changes, the list price in the opportunity product also changes.” For example, consider the example below

List PriceSales PriceDiscounted AmountDiscount %
$ 10000$ 5000$ 500050%

Now, If you change the list price amount in the price book entry of the product to $20,000, the list price in the existing opportunity product record also changes to $20,000. This causes the discounted amount calculation to be incorrect

List PriceSales PriceDiscounted AmountDiscount %
$ 20000$ 5000$ 15000150%

How do we address this requirement:

  1. I have created a custom field called “Custom List Price” in the opportunity product.
  1. When the opportunity product is created, we update the value of the Standard List Price in the Custom List Price through a flow.
  1. We’ve updated the custom formula fields (Discounted Amount, Discount %) to incorporate a Custom List Price field instead of the Standard List Price.
  1. Next, we updated the existing record’s Standard List Price to a Custom List Price using the data loader.

5. We replaced the Standard List Price with the Custom List Price in the layout.

      Conclusion

      In conclusion, the limitation of the opportunity product’s list price being incorrectly updated when the product’s price book entry changes was effectively addressed by creating a “Custom List Price” field. By leveraging this custom field, we ensured that the calculations for Discounted Amount and Discount % remained accurate and unaffected by changes in the product’s standard list price. The solution involved updating the custom field through a flow when the opportunity product is created, modifying existing records with the data loader, and adjusting the layout to reflect the custom field instead of the standard list price. This approach successfully prevents the list price in the opportunity product from being unintentionally altered, thereby maintaining the integrity of the discount calculations for old orders.

      Leave a Reply

      Your email address will not be published. Required fields are marked *