Error message when you try to enter a payables transaction in Microsoft Dynamics GP: "Unable to generate next payment number" or "Unable to generate next voucher number"


Symptoms


When you try to enter a payables transaction in Microsoft Dynamics GP, you receive one of the following error messages:
Error message 1
Unable to generate next voucher number.
Error message 2
Unable to generate next payment number.

Cause


This problem can have any of the following causes.

Cause 1

The Next Payment Number/Voucher Number field is not populated. See Resolution 1 in the "Resolution" section.

Cause 2

The Next Payment Number/Voucher Number field does not have a large enough number. See Resolution 2 in the "Resolution" section.

Cause 3

The Next Payment Number/Voucher Number field does not start with leading zeros. See Resolution 3 in the "Resolution" section.

Cause 4

The Next Payment Number/Voucher Number field contains letters. See Resolution 4 in the "Resolution" section.

Cause 5

Data in the Payables Transaction Logical File group is missing or is corrupted. See Resolution 5 in the "Resolution" section.

Resolution


Note Before you follow the instructions in this article, make sure that you have a complete backup copy of the database that you can restore if a problem occurs.

NoteResolutions 1, 2, 3, and 4 will make use of the Payables Setup Options window. To access the Payables Setup Options window, click on the Options button after launching the Payables Management Setup window. To launch this window, please use the appropriate option:
  • In Microsoft Dynamics GP 10.0, point to Tools on the Microsoft Dynamics GP menu, point to Setup, point to Purchasing, and then click Payables.
  • In Microsoft Dynamics GP 9, point to Setup on the Tools menu, point to Purchasing, and then click Payables.

Resolution 1

To resolve this problem, type a number in the Next Payment Number/Voucher Number field in the Payables Setup Options window. To access this window, follow the appropriate method:
  • In Microsoft Dynamics GP 10.0, point to
    Tools on the Microsoft Dynamics GP menu, point to
    Setup, point to Purchasing, and then click
    Payables. Next, click the Options button.
  • In Microsoft Dynamics GP 9.0, click on
    Tools, point to Setup, point to
    Purchasing, and then click Payables. Next, click the Options button.


NoteDocument types of Invoice, finance charge, miscellaneous charge, return and credit memo use voucher numbers, while checks (whether manual payments or computer checks) use payment numbers.

Resolution 2

To resolve this problem, enter a larger number in the Next Payment Number/Voucher Number field in the Payables Setup Options window that is higher than the maximum number already used. To determine the voucher number or highest payment number of the highest value that has already been used, use the steps below:
  1. 1. Start the Support Administrator Console, Microsoft SQL Query Analyzer, or SQL Server Management Studio. To do this, use one of the following methods depending on the program that you are using:
    • Method 1: For SQL Server Desktop Engine. If you are using SQL Server Desktop Engine (also known as MSDE 2000), start the Support Administrator Console. To do this, click Start, point to
      All Programs, point to Microsoft Administrator Console, and then click Support Administrator Console.
    • Method 2: For SQL Server 2000. If you are using SQL Server 2000, start SQL Query Analyzer. To do this, click
      Start, point to All Programs, point to
      Microsoft SQL Server, and then click Query Analyzer.
    • Method 3: For SQL Server 2005. If you are using SQL Server 2005, start SQL Server Management Studio. To do this, click
      Start, point to All Programs, point to
      Microsoft SQL Server 2005, and then click SQL Server Management Studio.
    • Method 4: For SQL Server 2008. If you are using SQL Server 2008, start SQL Management Studio. To do this, click
      Start, point to All Programs, point to
      Microsoft SQL Server 2008, and then click SQL Server Management Studio.
  2. Click on New Query and select the company database.
  3. Run the following the appropriate script against the company database to identify the record that has the highest voucher / payment number
    • To determine the highest voucher number, proceed with running this script:
      select max (CNTRLNUM) from PM00400 where CNTRLTYP = 0
    • To determine the highest payment number, proceed with running this script:
      select max (CNTRLNUM) from PM00400 where CNTRLTYP = 1

Resolution 3

To resolve this problem, make sure that the number in the
Next Payment Number/Voucher Number field in the Payables Setup Options window starts with leading zeros. For example, if the number starts with "999," change the number to "0000000999."

Resolution 4

To resolve this problem, make sure that the number in the
Next Payment Number/Voucher Number field in the Payables Setup Options window has no letters or alpha-numeric characters.

Resolution 5

To resolve this problem, perform the Check Links routine on the Payables Transaction Logical File. Have all users log out of Microsoft Dynamics GP before proceeding. To do this, follow these steps.

WARNING If you use Microsoft Dynamics GP 9.0, you must install Service Pack 2 before you follow these steps. The "Check Links" process may incorrectly remove applied records if you run "Check Links" in Microsoft Dynamics GP 9.0 or in Microsoft Dynamics GP 9.0 Service Pack 1.
  1. Follow the appropriate step:
    • In Microsoft Dynamics GP 10.0, point to
      Maintenance on the Microsoft Dynamics GP menu, and then click Check Links.
    • In Microsoft Dynamics GP 9.0, point to
      Maintenance on the File menu, and then click
      Check Links.
  2. In the Series list, click
    Purchasing.
  3. Click Payables Transaction Logical File, click Insert, and then click OK.
  4. When you are prompted to print the error log, click a destination, and then click OK.