function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
prbprb 

Opportunity Line Item Quantity is Truncated - But Only Thru SF GUI

I have professional services line items that I add through the SOAP API and through the data loader and these external tools allow me to add values such as ".385" days.  When I try to add the same value through the SF GUI it truncates the value to ".38".
This is frustrating since the database obviously allows long decimals.
Has anyone found a way to allow the user to add quantity values with more than 2 decimals for opportunity line items, or any other numeric field with this limitation?  I'm wary of creating my own quantity field as this is will inevitably foul up some other reports we've already written.
Does anyone have a workaround?  I have already tried creating a trigger that updates the quantity based on a custom field, but the field is always truncated.
I hope there's an easier solution than creating a custom field and sending an outbound message to update the field with  a web service, but I don't see any other way to solve this.
Thanks




Message Edited by prb on 11-25-2008 07:04 AM
advlgxpmadvlgxpm
Are you sure that your API insert is not rounding your .000 number to a 2 digit suffix? If you look at the data type properties for List Price on opportunity products, it is a Currency(16, 2) which to me indicates 2 decimals is only allowed.
prbprb
No I have 3 decimal values in the quantity field.  I'm positive of that.  I can see the values in the APEX explorer and the total is based on the three digit decimal * unit price.


advlgxpmadvlgxpm
Interesting..... It must be a limitation of the gui then as ListPrice is uneditable in terms of modifying the field properties. you might be able to do it with custom APEX code/visual force pages then.
advlgxpmadvlgxpm

Also, you said:

I have already tried creating a trigger that updates the quantity based on a custom field, but the field is always truncated.

Did you try your "alternate" field as a number field, instead of currency, with 3 decimal places then updating the ListPrice with your trigger?
 

prbprb
Yes I have tried using a trigger and a workflow rule with a custom field and updating the Quantity field.  No dice.
APEX has the same behavior as the GUI.  It truncates the decimal when you update or insert.
Only the data-loader and the API allow you to post a 3-digit value.
I suspect because they are parsing the String value into a Double value in the SOAP API.