From July 9th till 13th we will be at #MSInspire. See you there!

Number Sequences in Dynamics AX 2012

Number Sequences in Dynamics AX 2012
06 Mar 2014

An Oveview of the Various Number Sequences in Dynamics AX 2012

A number sequence is a readable, unique identifier for a master data record or transaction. The behavior of a number sequence is similar to primary key in a relational database. But it has more advance features that we do not have in primary keys like custom format, scoping etc. A Reference is the record that requires number sequences in dynamics as an identifier. To use number sequences with a transaction or master data we first have to setup the number sequence for that reference. Once the number sequence is setup we have to specify the scope. Microsoft Dynamics AX 2012 provides different scopes for different number sequences, based on business need. Below is the list of scopes available in Dynamics AX 2012 R2.

  • Shared
  • Company
  • Legal Entity
  • Operating Unit Type

Shared Scope

The number sequences in dynamics is generated by Shared scope is applicable to all the shared tables, for example Purchase Requisition, Products, etc. Shared scope can’t contain segments that correspond to scope. By including the scope segment in number sequence format, we can identify the scope of a particular record by looking at its number. In Shared scope the focus is on the complete organization and the number sequence is unique for all the organizational entities, so the same format can be used to identify different parts of the organization, via a unique number sequence.

For Example
Purchase requisition numbers

In the following example, we’ll discuss purchase requisition numbers that are organization wide.

Area: Purchase
Reference: Purchase requisition
Scope: Shared

Dynamics AX Shared Scope Number Sequence1

Example of formatted number: Req0001

Company Scope

Number Sequences in dynamics is generated using the Company Scope are unique at a company level but can be duplicated in different companies. A Company Scope Number sequence is applicable to all those tables that have “Data Area Id”. A good example of this is Purchase Orders, Sales Orders, etc. In Dynamics AX 2012 R2, virtual companies are also included in company scope. Although we cannot use module specific forms to set up number sequences for virtual companies.

We must use forms in Organization administration instead.

For Example
Sales order numbers

In the following example, Sales Order numbers are set up for the company ID CEU.

Area: Sales
Reference: Sales Order
Scope: Company
Scope: CEU

Dynamics AX Shared Company Scope Number Sequence

Example of formatted number: SO-0010

Even though a scope segment is not included in the format, the numbering restarts from each company ID. Therefore if you use the same format for all company IDs, the same numbers are used in each company. For example, sales order number SO-0010 can be used in each company and will still be unique due to the unique Company ID that precedes it.

You can also change the whole number sequence format for the other company IDs.

Legal Entity Scope

These Number Sequences are setup for legal entities. A legal entity basically represents the legal structure in a business. Number Sequence with legal entity consist of segments. Legal Entity combined with Fiscal Calendar Period can be used to create more specific number sequences.

Legal Entity is typically used in tables that do not have Data Area Id to distinguish between entities. These tables use Legal Entity to separate the data.

For Example
Expense report numbers

In the following example, expense report numbers are set up for the legal entity that is titled CS.

Area: Travel and Expense
Reference: Expense Report Number
Scope: Legal Entity
Scope: CS

Dynamics AX Shared Legal Entity Scope Number Sequence

Example of formatted number: CS-EXPENSE-0039

We can set up a similar number sequence format for other legal entities. For example, for a legal entity that is named RW, if you change only the value of the legal entity segment, the formatted number is RW-EXPENSE-0039. We can also change the whole number sequence format for other legal entities. For example, we can omit the legal entity scope segment to create a formatted number such as Exp-0001.

Operating Units Type

Previously a single number sequence was generated for operating units. In Dynamics AX 2012 R2 we have support for Operating Unit Type number sequences. With this we can generate a number sequence per operating unit type. This helps differentiate between operating units within the same organization. An Operating Unit Type number sequence uses operating units that are either in-built operating unit type or custom operating unit types created by users. We’ll look into the creation of Operating Unit Types in detail in another post.

While creating the number sequence segment that corresponds to the scope, the number sequence format can contain Constant and Alphanumeric segments. A constant segment contains a set of letters, numbers or symbols that does not change. An alphanumeric segment contains a set of letters or numbers that increment every time that number is used. A hash sign (#) is typically used to represent incrementing numbers and an ampersand symbol (&) is used to represent incrementing letters/numbers.

For example, the format #####_2014 creates the sequence 00001_2014, 00002_2014, and so on.

I hope this post gives you a better idea about number sequences in Dynamics AX. In my next post we’ll look at the steps involved in creating number sequences.


Noc Folio3