Microsoft Dynamics AX Support

This blog contains posts by the Microsoft Dynamics AX Support teams Worldwide

Issue with number sequence after upgrade to AX2012 R2 in place.

Issue with number sequence after upgrade to AX2012 R2 in place.

  • Comments 4

When you have a number sequence that is set to continuous and the number that pulls into the form is 000000 and is not a valid number.

This is caused by the Stored Procedure not getting updated when the R2 in place upgrade process is complete.  We suspect that this problem may be due to incorrect steps done during the upgrade that we are not able to reproduce.

This blog describes the steps on how to copy the stored procedure from a working environment to resolve the issue with the no value pulling from the number sequence table.

To copy out the stored procedure from a working data base you will use the following steps. 

  1. Open SQL Server Management Studio
  2. Log in
  3. Expand Databases
  4. Select MicrosoftDynamicsAX or whatever you have it named and expand
  5. Expand Programmability
  6. Expand Stored Procedures
  7. Right Click on dbo. getNumInternal
  8. Click Modify


 9. Select all and Copy the code

Now in the non-working data base you will do the same steps but you will paste the code into the stored procedure.  You will need to change the top line to use the database name that is not working. 

Then you can execute the code by clicking the Execute button.  

Please make sure you have a backup of your data base before you try these steps.  You will need to restart the AOS and AX after you have run this code.

If you are still having an issue with the Number Sequences not advancing you will then want to check the permissions on the stored procedure.

Here are also the steps to do this:

  1. Log in to SQL Server Management Studio.  You can go to Start | All Programs | access your SQL application and open SQL Server Management Studio.
  2. Log in to the SQL Server being used.
  3. Expand Databases.
  4. Expand MicrosoftDynamicsAX or the AX database being used.
  5. Expand Programmability.
  6. Expand Stored Procedures.
  7. Find getNumInternal and right click to open Properties.


   8. Select Permissions and check the permission setup for the user.

Test adding the user that is currently logged on to the list and ensure that the Execute option has Grant marked

Go back to Microsoft Dynamics AX and test that the number sequence is now working.

Leave a Comment
  • Please add 5 and 5 and type the answer here:
  • Post
  • Thanks a lot!

    I had the error that NumberSequence::getNextNumber method always returned zero after R2 upgrade.

    Copying getNumInternal stored procedure from a correctly upgraded R2 instance did the trick.

  • Thanks a lot!

    you saved our team from the big trouble....

  • Great! Save a lot of trouble......thanks

  • This helped me in fixing the number sequence problem. Thanks a lot.

Page 1 of 1 (4 items)