Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Index 0 of array 'Pay YTD Array is out of range in script' Print_YTD_Paycode. Script Terminated

(1) ShareShare
ReportReport
Posted on by

Hello,

This isn't actually a question, but rather an answer to a question I had to create a case with Microsoft for. A client of mine received the error message during the Print Checks process "Index 0 of array 'Pay YTD Array is out of range in script' Print_YTD_Paycode. Script Terminated."

After looking through our employees and verifying pay codes were correct, they had YTD amounts, and nothing looked out of the ordinary, I eventually had to create a case with Microsoft.  The resolution is a simple one, but NOT one that clients may like.

The reason they received this error message during the print checks process is because there was an employee with more than 12 pay codes with a year to date amount. The GP check (and direct deposit statement) can only handle 12 pay codes. Unlike the AP check, that prints a separate remittance with more than 12 invoices, the payroll check does not do that.

The solution? Uncheck the option to include YTD amounts for Pay Codes in Setup > Payroll > Payroll.

This is not a good solution, as this will no longer print any year to date amounts for pay codes on any pay stub, whether a check or a direct deposit earnings statement.  Our resolution? We combined a couple pay codes for the employee and changed the business process so that all 3,000 employees could see their YTD amounts.

Moral of the story? Consultants - please advise clients that having too many pay codes for your employees could cause issues down the road. This, of course, is only applicable if they are actually PAID with more than 12 pay codes in one single year.

I hope you found this helpful, and if I should have posted this somewhere else, I apologize. I just thought it needed to be put somewhere online, as I was not able to find one single resource with a solution.

Thanks and kind regards,

Heidi

PS - even though I had to choose a version (GP2013) this applies to all versions of GP.

*This post is locked for comments

  • Verified answer
    Community Member Profile Picture
    on at
    RE: Index 0 of array 'Pay YTD Array is out of range in script' Print_YTD_Paycode. Script Terminated

    I actually need to correct my first post. The maximum number of pay codes you have is 25 year to date, not 12.

  • Don Wisch Profile Picture
    660 on at
    RE: Index 0 of array 'Pay YTD Array is out of range in script' Print_YTD_Paycode. Script Terminated

    Nice job Heidi :)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

#1
Almas Mahfooz Profile Picture

Almas Mahfooz 3 User Group Leader

Featured topics

Product updates

Dynamics 365 release plans