Issue : Missing number increment within a continuous number sequence

Posted by

Error message : no particular error message

Version : D365FO

Localization : #NA

Critical : Blocking

French message : sans objet

In the screenshot below, the voucher numbers are not continuous. The number 4 is not there even if that number sequence is setup as a continuous one. To fit the french accounting rules, it has to be continuous.

As you can see, nothing seems wrong in the setup.

Explanation :

In case of a power failure, an application error, or other unexpected failure, the system cannot recycle numbers automatically for continuous number sequences. You can run the cleanup process manually or automatically to recover the lost numbers.

Carefully consider server usage when you plan the cleanup process. We recommend that you perform the cleanup as a batch job during non-peak hours.

Source :

Solution :

The first thing to do is to try a manual cleanup of the number sequence. There are 2 possibilities: Current or All. The 2 options are quite the same except the fact that All will apply on all continuous number sequences (Current will only apply for the selected one).

After selecting Current in this example, a pop-up prompts and we notice there is a filter on the RecId of the number sequence.

Be aware that this process is machine resource consuming. Microsoft advise us to run it during off-peak hours (especially if you choose All instead of Current).

After this is done, we can try to create a new voucher where the Status list is available.

This form displays the numbers that will be allocated for the number sequence.

Sometimes, this solution will not solve the issue. The missing number is still not re-used. Here is 2 queries given by Microsoft that you need to run.

Select RecId, Partition, * from NumberSequenceTable where numbersequence = ‘[CodeSouche]’

If the previous query result with only one record, it means the number sequence to fix has been identified.

If not, you need to correct the code: the RecId and the Partition should be used in the following query (and the missing number of course).

insert into NumberSequenceList(NextRec,NumberSequenceId,Status,UserId,modifiedby,partition) values([MissingNumber], [NumberSequenceRecId],1,’Admin’,’Admin’,[Partition])

By going back to the Status form, we notice the query has created a line for the missing number. If a new voucher is created the missing number will be allocated finally.

Note: in our case, we must have created 2 vouchers to make it work

As this is a live issue, it was up to Microsoft to run it in live environment and us to test in the dedicated sandbox.

Tips and tricks :

The history form allows to check the setup changes on the current number sequence.

If you encounter this issue, you could check if the number sequence has been setup as continuous all the time.

Other comment: Not tested in AX 2012 but as it seems not to have a lot of change on number sequences it should be worth to test it.

Guillaume FAGES

Leave a Reply

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *