"Unhandled Script Exception: Set Precision.." when selecting item in Item Maintenance window

Background

The user was attempting to select an item in the Item Maintenance window and received the error:

Unhandled script exception:
set precision passed bad precision value -1.

EXCEPTION_CLASS_SCRIPT_OUT_OF_RANGE
SCRIPT_CMD_SETPRECISION

The error only happened for a handful of items in a catalog of a few thousands.

Solution

Dynamics will attempt to set the decimal precision for the currency and quantity fields on the Item Maintenance window based on the number of decimal places for the functional currency (this is the default) or based on the number of decimal places used to define the item list price under the Item Currency Maintenance window; and in the case of the quantities, the number of decimal places for the quantities. To fix the issue, you will want to look at the columns DECPLQTY and DECPLCUR for any values at or below zero which would sure render an incorrect precision value when Dynamics GP attempts to set the value of the drop-down list on the screen. In this case, a zero value in any of these columns will result in a precision value of -1, when the system attempts to set the drop-down list value.

The following query will identify any suspect records causing the problem:

SELECT * FROM IV00101 WHERE (DECPLQTY <= 0) OR (DECPLCUR <= 0);

SELECT * FROM IV00105 WHERE (DECPLCUR <= 0);

To fix, you will want to at least set them to the values of your functional currency, for example:

UPDATE IV00101 SET DECPLQTY = 3 — 2 decimals
WHERE (DECPLQTY <= 0);

UPDATE IV00101 SET DECPLCUR = 3 — 2 decimals
WHERE (DECPLCUR <= 0);

UPDATE IV00105 SET DECPLCUR = 3 — 2 decimals
WHERE (DECPLCUR <= 0);

Until next post!

MG.-
Mariano Gomez, MVP
Maximum Global Business, LLC
http://www.maximumglobalbusiness.com

Advertisements

2 Responses to "Unhandled Script Exception: Set Precision.." when selecting item in Item Maintenance window

  1. Thanks for the posting. It gave me just the hint I needed. I was getting the same error after importing item into GP. But it seemed the decimal places for the item was missing. Thanks

  2. Crystal,Glad I could help and thanks for the feedback.MG.-Mariano Gomez, MVP

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: