Error message when you click the PO Number field in the Purchase Order Entry window or when you click the Receipt No. field in the Receivings Transaction Entry window in Microsoft Dynamics GP: "A unique number couldn't be assi...


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.

Symptoms


When you click the PO Number field in the Purchase Order Entry window in Microsoft Dynamics GP or in Microsoft Business Solutions - Great Plains 8.0, you receive the following error message:
A unique PO number couldn't be assigned. Check the Next Number field in the Purchase Order Processing Setup window.
Or, when you click the Receipt No. field in the Receivings Transaction Entry window in Microsoft Dynamics GP or in Microsoft Business Solutions - Great Plains 8.0, you receive the following error message:

A unique receipt number couldn't be assigned. Check the Next Number field in the Purchase Order Processing Setup window.

Cause


This problem has one or more of the following causes:

Cause 1

The next purchase order number or the next receipt number in the Purchase Order Processing Setup window has already been used. To resolve this problem, see resolution 1.

Cause 2

The Next Number field for purchase orders or for receipts in the Purchase Order Processing Setup window does not contain enough leading zeros to increment to the next number. To resolve this problem, see resolution 1 and resolution 2.

Cause 3

The regional and language options on the workstation differ from those settings on the server. To resolve this problem, see resolution 3.

Cause 4

The data in the Purchase Order Processing Setup window is damaged. See resolution 4.

Resolution


To resolve this problem, use one of the following resolutions.

Resolution 1: Increase the next purchase order number or the next receipt number by one

To use this method, follow these steps:
  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. Run the following scripts against the company database to determine the largest purchase order number that is used.
    SELECT max (PONUMBER) as 'max po number: WORK' FROM POP10100
    SELECT max (PONUMBER) as 'max po number: HIST' FROM POP30100
    Run the following scripts against the company database to determine the largest receipt number that is used.
    SELECT max (POPRCTNM) as 'max receipt number: WORK' FROM POP10300 
    SELECT max (POPRCTNM) as 'max receipt number: HIST' FROM POP30300
  3. Run the following scripts against the company database to determine the next purchase order number.
    SELECT PONUMBER as 'next PO number' FROM POP40100
    Run the following scripts against the company database to determine the next receipt number.
    SELECT POPRCTNM as 'next receipt number' FROM POP40100
    Notes
    • Table POP10100 is the Purchase Order Work table.
    • Table POP30100 is the Purchase Order History table.
    • Table POP10300 is the Purchasing Receipt Work table.
    • Table POP30300 is the Purchasing Receipt History table.
    • Table POP40100 is the Purchasing Setup Table table.
  4. In the Purchase Order Processing Setup window, make sure that the next purchase order number or the next receipt number is greater than the value that you obtained in step 2.
  5. Use the appropriate method for your version of the program:
    • Microsoft Dynamics GP 10.0

      Click Microsoft Dynamics GP, point to Tools, point to Setup, point to Purchasing, and then click Purchase Order Processing.
    • Microsoft Dynamics GP 9.0 or Microsoft Great Plains 8.0

      Click Tools, point to Setup, point to Purchasing, and then click Purchase Order Processing.

Resolution 2: Add leading zeros to the next purchase order or receipt number


If the purchase order number or the receipt number does not increment, add leading zeros to the next purchase order number or to the next receipt number. To do this, follow these steps:

  1. Use the appropriate method for your version of the program:
    • Microsoft Dynamics GP 10.0

      On the Microsoft Dynamics GP menu, point to Tools, point to Setup, point to Purchasing, and then click Purchase Order Processing.
    • Microsoft Dynamics GP 9.0 or Microsoft Great Plains 8.0

      On the Tools menu, point to Setup, point to Purchasing, and then click Purchase Order Processing.
  2. In the Next Number column, enter leading zeros to the values in the following fields:
    • Purchase Orders
    • Receipts
  3. Click OK.

Resolution 3: Change the regional format options and language

Change the regional format options and language so that the settings match the same settings on the server. To do this, follow these steps:
  1. On the workstation, click Start, and then click Run.
  2. Type intl.cpl, and then click OK.
  3. Repeat steps 1 and 2 on the server.
  4. Verify that the settings in the "Regional and Language Options" window on the workstation match the same settings on the server.

Resolution 4: Change the Purchasing Setup Table table

Change the Purchasing Setup Table table to resolve the problem. You can either use the Enable Identity Insert option to avoid duplicate records, or you can re-create the table. To do this, use the appropriate method.

Method 1: Avoid duplicate records in the Purchasing Setup Table table (POP40100)

To avoid duplicate records in the Purchasing Setup Table table (POP40100) in the future, click the Enable Identity Insert option when you use Data Transformation Services (DTS) or the SQL Server Import and Export Wizard to transfer data from one database to another database.

Method 2: Re-create the Purchasing Setup Table table (POP40100)

Notes
  • Before you use this method, you must have all users log off Microsoft Dynamics GP and Microsoft Great Plains 8.0.
  • Before you use this method, make sure that you have a complete backup copy of the database that you can restore if a problem occurs.
To re-create the Purchasing Setup Table table, use one of the following methods.

Method 2A: Use the Professional Services Tools Library (PSTL) toolkit

  1. Install the PSTL toolkit. To do this, follow these steps:
    1. For more information about the Professional Services Tools Library, use one of the following options:

      Customers:
      For more information about PSTL, contact your partner of record. If you do not have a partner of record, visit the following web site to identify a partner: Microsoft Pinpoint

      Partners:
      For more information about PSTL, visit the following web site:

      https://mbs.microsoft.com/partnersource/downloads/releases/noam_pstl.htm
    2. Copy the Professional Services Tools Library .cnk file to the Microsoft Dynamics GP directory or the Microsoft Great Plains 8.0 directory on the computer that is running Microsoft Dynamics GP or Microsoft Great Plains 8.0.
    3. Log in to Microsoft Dynamics GP or to Microsoft Great Plains 8.0. When you are prompted to include new code, click Yes.
  2. Click the PSTL toolkit shortcut on the shortcut bar to initialize the tables.

    Note If the PSTL toolkit shortcut does not appear on the shortcut bar, add the shortcut. To do this, follow these steps:
    1. Use the appropriate method for your version of the program.

      • Microsoft Dynamics GP 10.0

        Click Layout. Make sure that the Navigation Pane option is selected.
      • Microsoft Dynamics GP 9.0 or Microsoft Great Plains 8.0

        Click View, and then click Navigation Pane.
    2. Use the appropriate method for your version of the program.
      • Microsoft Dynamics GP 10.0

        Right-click Shortcuts, point to Add, and then click Add Window.
      • Microsoft Dynamics GP 9.0 or Microsoft Great Plains 8.0

        Click Add, and then click Other Window.
    3. Expand Technical Service Tools, expand Project, click Professional Services Tools Library, and then click Add.
    4. Click Done.
  3. When you are prompted to enter utilities registration code, click OK.
  4. Click Toolkit, and then click Next.
  5. Click Recreate SQL Objects, and then click Next.
  6. In the Series list, click Purchasing.
  7. In the Table list, click table POP40100.
  8. Click Recreate Selected Table.
  9. Click to select the Recreate data for selected table(s) check box.
  10. Click Perform Selected Maintenance.

Method 2B: Run the SQL Maintenance function

  1. Print the POP Setup List report to obtain the current setup information. To do this, follow these steps:
    1. Click Reports, point to Purchasing, and then click Setup/Lists.
    2. In the Purchasing Setup Reports window, click Purchase Order Proc Setup in the Reports list, specify the report option, and then click Print.
    Note The Purchasing Setup Table table will remain empty until the information is re-entered in the Purchase Order Processing Setup window.
  2. Use the appropriate method for your version of the program.

    • Microsoft Dynamics GP 10.0

      Point to Maintenance on the Microsoft Dynamics GP menu, and then click SQL.
    • Microsoft Dynamics GP 9.0 or Microsoft Great Plains 8.0

      Point to Maintenance on the File menu, and then click SQL.
  3. In the Database list, click the company database that you use.
  4. In the Name column, click Purchasing Setup Table.
  5. Click to select the following check boxes:
    • Recompile
    • Update Statistics
    • Drop Table
    • Create Table
    • Drop Auto Procedure
    • Create Auto Procedure
  6. Click Process.