Wednesday, November 4, 2009

"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

6 comments:

Crystal Clear said...

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

Mariano Gomez said...

Crystal,

Glad I could help and thanks for the feedback.

MG.-
Mariano Gomez, MVP

Neil said...

Hi Mariano

I get the same message when I try to reconcile debtor information. Do you have any ideas? Neil Lombard

Mariano Gomez said...

@Neil: the first thing you will need to do is capture a DEXSQL.LOG to at least determine what record in what table during the process is causing GP to choke.

Post back with your findings.

Anonymous said...

MAriano:
Thanks for posting this. it helped me resolve a similar error - user received this error drilling down from GL Transaction Inquiry to PMTRX transaction:

(I happen to be upgrading a GP10 instance to GP2015)
in GP2015:
Unhandled script exception:
SCRIPTS - data area
EXCEPTION_CLASS_SCRIPT_OUT_OF_RANGE
SCRIPT_CMD_INDEX

In GP10:
Unhandled Script Exception:
Index 0 of array 'PM Transaction Abbreviation' is ot of range in script 'PM_Transaction_Inquiry_Scroll_FILL'. Script Terminated

Resolution:
There were a few very old or orphaned records in PM00400 that had a docdate of 1/1/1900 and TRXSORCE = '' and had to be deleted.

DELETE PM00400 where DOCDATE='1900-01-01' and TRXSORCE = ''

Habib

Anonymous said...


Hi

I receive this message when I try to post an intercompany invoice

EXCEPTION_CLASS_SCRIPT_ILLEGAL_OP
SCRIPT_CMD_EXCEPTION_CLASS

Thanks

Diane