TransWikia.com

"Start Sync" On Quote setting different Unit Price on Opporutuniy Line Item when Discount has many decimal places

Salesforce Asked on December 28, 2021

When using the standard Start Sync button on a quote and having many decimal places in the discount, the Unit Price seems to change on the related Opportunity Line Item (OLI) attempting to be created.

We block (with a validation rule) users from updating Quote Line Items as the values/insertion of them come from our Quoting system which is the source for this. If the OLI is changing on Start Sync, the start sync fails.

It seems specific to situations that have discounts/price with many decimal places.

Quote Line Item

  • Unit Price = 133.33
  • Discount = 9.99775
  • Total Price = 119.99999992
  • Quantity is 1
  • Unit Price is Currency(16,2)
  • Discount is Percent(3,2)
  • Total Price is Currency(16,2)
  • Price book’s list price is 0.00 on product
  • We have multiple currencies, but the opportunity in question is in
    USD (our corporate currency).
  • USD conversion rate is 1.000000 and set to 2 decimal places.

Ignoring the obvious to not allow these decimal places to come, I’d like to understand the behavior here.


I added a QuoteLineItem trigger to see what was trying to change and what seems to be occurring is the following:

  • Unit Price on the OLI is changing to 133.3300001
  • Total Price on the OLI is to 119.99999993

This, in turn, is syncing back to the Quote Line Item and hitting our validation rule. The other fields seem to be exact. Below is an image of the exact debug statement.

enter image description here

We have no automation on OLI or Quote Line Items.

My expectation would be that the “Start Sync” would simply copy over the Quote Line Item (as is). Even if it does “recalculate” the total price potentially as mentioned here, I’m not sure how they ended up with those numbers since 9.99775% off 133.33 = 120.0269925. Even trying to cut off certain decimals, I can’t find the math that explains it.

I did find documentation regarding OLIs for the following:

If you specify Discount without specifying TotalPrice, the TotalPrice
is adjusted to accommodate the new Discount value, and the UnitPrice
is held constant.

If you specify both Discount and Quantity, you must also specify
either TotalPrice or UnitPrice so the system knows which one to
automatically adjust.

However, I’m not sure if the above is coming into play (one being automatically adjusted) as it’s the “start sync” button vs. anything I’m in control over. The documentation on How Quote Syncing Works doesn’t really explain anything other than to say changes on one affect the other.

Is there any documentation or explanation for why “Start Sync” would be changing the values of the Quote Line Item on first sync?

One Answer

From the support case, a known issue was created. It was fixed in Spring '21.

The issue was specific to having a discount on a quote line item with more than 4 decimal places. Quote sync incorrectly changed the unit price of the corresponding created opportunity line items when you clicked "start sync".

Answered by Kris Goncalves on December 28, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP