Quotes Sync is adding decimal places and changing the Unit Price on Quote Line Items
Last updated 2020-11-17 ·Reference W-7665767 ·Reported By 2 users
When inserting a Quote Line Item record via API(Data Loader, Apex), it adds additional decimal places during quote sync. This occurs when Multi-Currency is enabled and the decimal place is set to 4.
1- Create Opportunity, Account and Quote
2- Create a Product with any Standard Price and assign it to a Pricebook. Make sure both are active.
3- Enable Multi-Currency and set the decimal for USD to 4
4- Create a Validation rule for quotelineitem, such as "NOT(ISNEW())" and make sure its active
5- Open the Quote and add the Product created in step 2 and set the following values,
6- Quantity: 1, Unit Price: 133.33, Discount: 9.99775
7- Sync and notice, there are no issues, all is well.
8- Now, via Apex Developer Console, open Execute Anonymous and insert the quotelineobject as follows(change the ids to your own relevant ones) (use the section "Code snippet to use" below.
Code Snippet to use(Execute Anonymous Window in Dev Console):
QuoteLineItem quoteLineItemObj = new QuoteLineItem();
quoteLineItemObj.UnitPrice = 133.33;
quoteLineItemObj.Quantity = 1.0;
quoteLineItemObj.Discount = 9.99775;
quoteLineItemObj.Product2Id = '01ti0000001QupcAAC';
quoteLineItemObj.PricebookEntryId = '01ui000000iQsqaAAC';
quoteLineItemObj.QuoteId = '0Q0q0000000Jezx';
Either manually insert the record or round off to a whole number for the discount price
Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.