Number Sequences Explained: D365 Finance and Operations

Number sequences in Dynamics 365 Finance and Operations (Dynamics 365) are used to systematically and automatically generate and manage the unique identifiers for different types records throughout the system. There are a large number of types of records that require a number sequence before the record and be successfully created. Some examples are customers, vendors, sales order, purchase orders etc.

Number sequences can be utilized to help easily identify certain types of records throughout the system just by adding a certain prefix or numbering convention to the number sequence that clearly indicates the type of record.In this article we will walk through the basics of number sequences including what you need to know about the number sequence form, how number sequences actually work, how to create a new number sequence from scratch, and how to run the number sequence wizard.

Number Sequences Form

First, we will take a look at the number sequence form and I will explain what all the fields mean and what you need to know when setting up a number sequence. 

  • To get to the number sequences list page navigate to Organization administration > Number sequences > Number sequences.

In the number sequences list page we are presented with all number sequences from all companies. We can start to filter this down by using the “Area” and “Reference” filters to find the number sequence we are looking for. In this case I’m going to filter on the “Accounts payable” area and “Vendor account” reference. This is going to show me all the number sequences with vendor account as a reference.

  • Next click the hyperlink to open the number sequence form.
  • The “Number sequence code” is the unique identifier of the number sequence and is what you would select when you associate a number sequence to a record type (reference) in the system.
  • The “Name” field is just a description field.
  • The “Scope” field is a way you can define the scope of the number sequence. For example you may want a certain number sequence to be shared across companies and all others to be per legal entity or company.
  • The “Segments” section is where you can build the format for the number sequence. In the example below the number sequence starts with the legal entity identifier as a prefix followed by a dash “-“ as a constant value and then a sequential string of numbers length of which is six digits. You can also see that it shows you a preview of how the number sequence will look in the “Format” field.
  • The “References” section is where the “Area” and “Reference” the number sequence is associated with is defined. In this example the number sequence is associated with the vendor account number, so the area is the accounts payable.
  • The “Reuse numbers” and “Use same number as” fields work together to in the following way. If you select the “Reuse numbers” option in the number sequence of certain number sequence references, for example, you can define that a vendor invoice be the same as the ledger voucher sequence number that gets generated upon posting the invoice. In some cases, this makes tracing and auditing transactions much easier because you are able to trace the voucher ID back to the subledger ID.
  • In the “Setup” section the “In use” slider just identifies that the  number sequence has been associated with a record type and is currently in use.
  • The “Manual” flag indicates if the number sequence should manually be assigned.
  • The “Stopped” flag allows you to put the number sequence on hold. For example, if I enable the “Stopped” flag and I try to create a vendor I will get an error saying, “Number sequence “Acco_1312 is on hold”.
  • The “Continuous” flag allows you to enforce a continuous number sequence or if you will allow gaps in the number sequence. Note: If you enable the “Continuous” flag the pre-allocation functionality is disabled. With the pre-allocation functionality turned off you can run into issues where number sequences get hung up. There is a fix for that as well as you will see later in the article. 
  • The “To a higher number” and “To a lower number” flag allows users to manually either modify the number sequence value to a higher number or lower number depending on which flag is selected.
  • The “Smallest” field lets you define the lowest numeric value allowed for the sequence.
  •  The “Largest” field allows you to define the highest numeric value allowed for the number sequence. Keep in mind this must match the number of digits defined in the “Alphanumeric” piece of the number sequence format defined in the “Segments” section.
  • The “Next” field indicates the next numeric value in the number sequence to be used.
  • The next section is the “Performance” section which explains the preallocation functionality. Basically, the preallocation functionality is to improve performance and what is does is, pre-allocates a set of numbers is the sequence to memory and when the system requests the next number in the sequence it retrieves it from memory instead of making a call to the database which takes longer.

How Number Sequences Work

In this section I’m going to show you how number sequences work with real examples and explanations. We will continue with the vendor number sequence example. You have seen the number sequence form and what the fields do now let’s actually see where you put the number sequence to use.

  • Since we are using a vendor account number sequence navigate to Accounts Payable > Setup > Accounts payable parameters.
  • Click the “Number sequences” tab.
  • Here you can see all of the “References” which really just means record types that you can assign number sequences to. I want to assign the number sequence we having looking at “Acco_1312” to the “Vendor account” reference.
  • Now let’s navigate to Accounts payable > Vendors > All vendors. 
  • Click the “New” button to create a new vendor. As you can see the vendor account number is “USPI-000002”. This is the format that was defined on the number sequence and it used the “Next” value which was “2”.

Now if we go back to the number sequence, we will see that the “Next” number is “27” so we would expect the next number to be 27 right? Wrong. Why? Because we have preallocation enabled which preallocates the next set of numbers but still issues numbers in sequential order.

As you can see if I create a new vendor record the sequence is “USPI-000003” which is the next number in the sequence.

Now if I go back and enable the “Continuous” flag, the “Next” number used will be the number in the “Next” field.

Another thing happens when you turn on the “Continuous” flag. When you create a record that generates the number sequence but do not commit the record, the system has to account for that by putting the record in the “Status” list. So if you ever have a case where you have a hung sequence number that seems to not increment to the next one and is causing an error you can delete it from the status list which acts kind of a number sequence cache in a way.

Also when you have the “Continuous” flag checked the “Cleanup” functionality is used to find any unused number and return it to the list of usable number sequence values. This can happen in cases where you may have an on-premises deployment and you have an unscheduled power outage or infrastructure failure.

If I enable the “Manual” flag and go create a vendor record you can now see that I am able to manually assign a vendor account number.

Now if we go back to the number sequence record, we can click the “History” button to see all of the history associated with the number sequence.

Create A Number Sequence

Now that you have seen how a number sequence works let’s create one.

  • Navigate to Organization administration > Number sequences > Number sequences.
  • Click the “Number sequence” button in the “New” section.
  • Give the number sequence a “Number sequence code” and a “Name”.
  • In the “Scope” select “Company” because we want the number sequence to only be for this company.
  • In the “Company” field select your company.
  • In the “Segments” section I do not want a company prefix so I am going to delete that by and only have a constant and a numeric sequence number. In this case my format is “TEST-##########”.

That’s all we need to do. Now we can replace the current vendor account sequence with this new sequence by navigating back to the Accounts Payable parameters and changing the number sequence for the vendor account to this new number sequence.

Now let’s go create a vendor and see the new number sequence.

Pretty cool. As you can see number sequences are very configurable and easy to set up and use.

Number Sequence Wizard

If you are implementing Dynamics 365 Finance and Operations (ERP) you will start out with a blank environment and you will need to either define hundreds of number sequences for each record type in the system or you can let the system do it for you automatically. The tool available is the number sequence wizard.

The majority of implementations I have been on we have utilized the number sequence wizard to generate standard or default number sequences for number sequences that we really don’t care about and then I go back with my clients and we change the ones we care about to a more meaningful and helpful number sequence. 

  • To use the number sequence wizard navigate to Organization administration > Number sequences > Number sequences.
  • Click the “Generate” button in the “New” section in the ribbon.

This will open a wizard dialog. Click the “Next” button to continue.

  • This list is showing you all of the number sequences that will be generated, the references (record types) they will be for, and the format. By default, the scope is company and the format is the company as the prefix followed by a number of numeric values. 
  • You can select and delete number sequences you do not wish to generate. By clicking the “Delete” button. Otherwise all the number sequences in the list will be generated.

Click the “Next” button and you will be presented with a summary screen showing you what all will be created.

  • Click the “Finish” button if you want to complete the wizard. Once you click finish the system will go an create each number sequence and associate the sequence with the respective reference in each of the system parameters like we saw earlier.

As you can see the number sequence tool is a powerful way to get you up and running in a very short amount of time.


In this article we have seen how number sequences work, how they are setup, some of the difference configurations for number sequences, and how to use the number sequence wizard. I hope this article has answered the majority of questions you may have had regarding number sequences in Dynamics 365 Finance and Operations or Dynamics AX for that matter because there are very few differences between the two versions.

Tim Woods

Tim has been an AX/D365 Finance and Operations Consultant for over a decade and loves to share insights and knowledge from multiple full cycle implementations.

Recent Posts