web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :

You may receive the following error when you run Payroll...Unhandled script exception: SCRIPTS - data area - EXCEPTION_CLASS_SCRIPT_OUT_OF_ RANGE SCRIPT_CMD_LINDEX

Terry R Heley Profile Picture Terry R Heley Microsoft Employee

**UPDATE** - There were changes made to the January 2021 Hotfix version 18.3.1233 so Microsoft Dynamics GP will handle this volume of transactions and YTD history printing on checks.

Wow...that is a mouth full of an error message isn't it???  Your first thought is, what did I do?  Payroll processed fine last time, I need to get payroll out and now this error I'm at a dead stop!!  HELP!!

Support starts to see this error typically around this time the beginning of the year, when you are rolling down changes to deductions and benefits and also maybe using the payroll code modifier, which allows you to change a name of your benefit, deduction, payroll pay code to a different name, way cool. (located under payroll utilities)  Then after really making several changes to records with roll downs you go to run payroll and this error appears during the calculate check:

Unhandled script exception:
SCRIPTS - data area - EXCEPTION_CLASS_SCRIPT_OUT_OF_RANGE SCRIPT_CMD_LINDEX

 

I'm sure you are thinking what I'm thinking why can't the error message just tell me what the problem really is, why so cryptic?  I know, I hear ya, thus the blog.

Typically this error does mean a frequency is missing.

What I have noticed with the cases and suspect the reason you are seeing this error occur is due to no frequency having been set for either a deduction, a benefit, or a pay code.

You all know from my tax blogs that frequency is key for tax calculation, so of course our engine blows up.

I have created a set of queries below to search the
UPR00400 (which is the Pay Code Master table) 
UPR00500 (which is the Deduction Master table) 
UPR00600 (which is the Benefit Master table) for records where no frequency has been set:

select EMPLOYID, PAYRCORD from UPR00400 where PAYTYPE = 0 or PAYPEROD = 0
select EMPLOYID, DEDUCTON from UPR00500 where DEDNFREQ = 0
select EMPLOYID, BENEFIT from UPR00600 where BNFTFREQ = 0

If these scripts return records, this will indicate that there is no frequency set for these codes. If they do not have a frequency set, then the best way to update these would be to do so through the front end of GP via the Pay Code Setup window, the Deduction Setup window, or the Benefit setup window, respectively, depending on which tables return results. These can all be accessed from Tools>Setup>Payroll>(choose appropriate option here). If there are a number of records returned, the quickest way would be to verify that all the deductions have the same frequency and update the frequency, for the DEDNFREQ column on the UPR00500 table for these employees. If it was a benefit(s) causing the issue, then you could just extrapolate the same steps and verify that the benefits have the same frequency and update the frequency, for the BNFTFREQ column on the UPR00600 table for these employees.

I would strongly suggest doing this in your test company first or have a good back up. You would also want to have someone verify that the rest of the settings are correct for the deductions/benefits.

Next question, why is this happening?  I have tested this a bit and so far I have not been able to recreate.  My theory is it has to do with something on the payroll code modifier and maybe a 3rd party dictionary that you have and I don't have :-)  always makes it more fun.

If any of you, figure that out, you email me so I can get to the bottom of the root cause of this problem.

Until then, I will keep working on it and here is a workaround for you if you get this error.

Another reason you may get the above error or errors such as:
“Index 0 of array ‘Deduction Amount YTD’ is out of range in script ‘Print_YTD_Deduction’
“Index 0 of array ‘Benefit Amount YTD’ is out of range in script ‘Print_YTD_Benefit'
“Index 0 of array ‘Pay code Amount YTD’ is out of range in script ‘Print_YTD_Pay code'

This is due to how many transactions you have for the employee.  Transactions could mean pay codes, deductions and benefits.  Typically we will see this issue only crop up once in a while and it based on what is going on this payroll.  For example employee Joe could have processed a payroll fine last week.  This week, payroll stopped with an error on Joe, due to the account split product we added and Joe also took or has Human Resource timecodes printing on their check, 10 of them alone.  In this example, Joe may error out on the payroll process.  The frustrating part is we just do not know when it may happen.  Items to look for that may cause this, if you are splitting employee pay to lots of different departments and positions.  Importing pay line items for items that really could be combined, import pay items that were part of a project that again, could be combined in payroll to one line as the pay code, pay rate, department and position are all the same. 


***UPDATE***

I have worked with a few customers on this and in their data set results, what we were seeing is the benefit frequency was blank on the Human Resource side and if you roll down changes (what we typically do in January) this could wipe out on the payroll side.  To make sure your data is clear of this error message for good, run the below scripts and make sure you have no blank frequency in the two HR tables below.  If you do, I would update them up correctly, so you will no longer have this issue.

Select * from BE020230 where BNFTFREQ = 0 --(SETUP)
Select * from BE010130 where BNFTFREQ = 0 -- (EMPLOYEE)

Example of an update:

Update BE010130 set BNFTFREQ = 2 where BNFTFREQ = 0 --sets them all to bi-weekly
(1=weekly, 2=bi-weekly, 3=semi-monthly, 4=monthly, etc.)
If you want to do this by Benefit name code add a restriction to it
Update BE010130 set BNFTFREQ = 2 where BNFTFREQ = 0 and BENEFIT ='INS'

Enjoy!

Terry Heley
Microsoft

Comments

*This post is locked for comments