Error 'Index 26 of array 'Pay YTD Array' is out of range in script 'Print_YTD_PayCode.' Script Terminated.' printing payroll checks Content provided by Microsoft Applies to: Dynamics GP 2010Dynamics GP 2013Microsoft Dynamics GP 2015Dynamics GP 2016 More Select Product Version All Products TechKnowledge Content IssueError occurs when printing Payroll Checks:Index 26 of array 'Pay YTD Array' is out of range in script 'Print_YTD_PayCode.' Script Terminated. Potential CauseYou can print the YTD amounts on the Check Stub for up to 25 Pay Code arrays. This error indicates that you have exceeded the 25 limit. ResolutionTo resolve this problem, under Microsoft Dynamics GP, click Tools , click Setup , click Payroll , click Payroll , and then click Options . In the Include Codes With YTD Amount on Checks section, click to clear the Pay Code check box. Note Other fields that also have a limit of 25 arrays are the following:• Deduction• Benefit• Local Taxes• State TaxesIf you receive similar errors on these fields, you will also need to clear the corresponding check box in the Include Codes With YTD Amount on Checks section. This article was TechKnowledge Document ID: 29015 Last Updated: 3/10/2017 Was this information helpful? Yes No Tell us what we can do to improve the article Submit Thanks! Your feedback will help us improve the support experience.