Skip to navigation Skip to content

Tech Insights 5 min read

How to create auto number fields in Dynamics 365?

Creating an auto number field in Microsoft Dynamics 365 can save you huge amounts of time, as well as making it easier to locate and identify important records. Automatically generating a number ID for each record of a specified entity requires the manual creation of a real-time workflow.

Never created a field in Microsoft Dynamics 365 and PowerApps before? Learn how to do it >

Create auto number fields in Dynamics 365

An auto number field is a field that you can include in an entity to generate numbered identification for each of its records. Although the software does automatically provide numbering for some ‘out of the box’ record types, such as invoices or cases, there may be many custom entities whose records you will also want to auto-number. Records for your customer accounts or sales opportunities, for example, will not be numbered automatically by the software.

Why should you create auto number fields in Dynamics 365?

With an auto number field, the number for each record will be handled entirely by the system, so there’s no need for you to identify each one as it is created. Auto number fields can save you huge amounts of time in numbering your records, and they allow for easier and faster identification of your records.

Auto number fields can be set up to automatically generate numbering for a broad range of different types of entity, and there are all kinds of formatting options available for them. This means that you should be able to set up auto numbering for any kind of situation where it might be necessary.

Things you need to know before creating auto number fields in Dynamics 365

When setting up a field as an AutoNumber data type, there are a few pre-defined auto number types available to you.

  • String prefixed number. This gives the auto number some text before it, eg. Account-103, ACCT-103, ACCT-104. What exactly this text is can be chosen by the user, by simply typing into the prefix box. The prefix gives an extra level of identification to the record, which could be helpful in finding the correct one at a glance.
  • Date prefixed number. With this auto number type, the number will be prefixed with the date and time that a record was created, eg. 2020-09-09-103, 20-09-10-104. This provides extra information about the record’s history without having to do any further research. You can choose from a number of different date and time formats.
  • Custom. If necessary, you can customize the formatting of the auto number field.

You have the option of choosing a seed value for your auto number generation, which is where the numbering of the records will start. For example, setting the seed value to 100 means that will be the first number in order for that set of records, and the next will be 101 etc., depending on how you set up the incrementation for that entity. It’s also worth bearing in mind that, when choosing a minimum number of digits for the auto number, the numbers may end up exceeding this length eg. after 999, the numbers will be four digits instead of three. A preview will be shown of what the auto numbering will look like, as you are modifying it.

How to create auto number fields in Dynamics 365

Dynamics 365 will generate number IDs for some entities automatically, such as Invoices. If you want to set up auto numbering for a custom entity like Accounts, Quotes, or other record types besides the out of the box ones, you’ll need to make use of a process that doesn’t directly involve the classic UI.

The standard user interface in Dynamics 365 doesn’t allow for auto numbering of custom entities. There are a few workarounds, one of which involves going into the API itself and using some basic code to modify the numbering. If your coding expertise isn’t up to this, or you don’t have the time, there are external solutions that can be implemented and third-party tools that can be installed. Some of these custom builds may be accessible online, and there is one useful new form editor at This allows you to change a text field data type into an auto number data type.

You don’t have time to do it yourself. Need help to create an auto-number field?

Do you have improvement needs in your Microsoft Dynamics 365 solution (Business Central or CRM) or support needs in your daily tasks? Book one of our advisers or developers now to help you. You are the master of your meeting, whether for direct training or for small improvements, we are there for you.

Book availability directly of our consultants to help you! With Microsoft technologies, we have put in place a tool that allows us to reserve our consultants and developers available at your leisure. You are responsible for informing the consultant of your needs during registration to ensure that he prepares for your request.

Book now your first GestiOnTheGo to create your autonumber fields with the help of an expert >

The process of creating auto numbering involves setting up a new entity and a record with Auto Number fields, then creating a relationship that will link this to the specific entities that you want to be auto numbered. You also need to set up a workflow process that will populate the fields with the correctly incremented numbers.

1. You’ll need to choose the solution where you want to work on. Then choose the entities where you would like to generate auto numbering for (Accounts and Quotes, for example).

2. Next, select New Field. Complete the Display name and the field Name. Select Autonumber in the Data Type.

3. You should then complete the following section of your AutoNumber field:

  • Autonumber type. Select between the three options: String prefixed number, Date prefixed number and Custom.
  • Prefix. The data type for these fields should be set to Text.
  • Minimum number of digits that your auto-generated number sequence will contain.
  • Seed value. The starting value of your autonumber field.

Then select Done.

These steps need to be repeated for each entity that you would like to have auto numbering for. Try creating some records, and you should see the number IDs for them being automatically generated.

How to insert an auto number field in a form?

Once you have create your auto number field, you can add the AutoNumber field in a form.

1. Select the Form where you want to add the auto number fiel, in the entity where you create it.

2. Once there, go to the Field explorer and select your auto number field.

3. You can then drag your auto number field on the form.

Auto number fields can be a great way to help your business save time, and keep more organized customer and client records. Once the process of setting them up has been carried out successfully a few times, you’ll be able to integrate them more easily into your database maintenance activities. They’re just one of the incredibly useful field types that can be created in Microsoft Dynamics 365. If you want more information and guidance on special fields, or any of the other benefits of Dynamics 365, reach out to Gestisoft today.

For over 20 years, Gestisoft has been providing crucial assistance to businesses of all sizes, offering them the benefits of its CRM expertise. Alongside consultations as to which CRM solution is the best for you, and technical demonstrations of the software, Gestisoft also creates custom implementations of Dynamics 365 and other CRM packages, tailored to the specific needs of a business.

Liked what you just read? Sharing is caring.

September 02, 2020 by Frédéric Charest VP of Marketing

Data-driven Growth Marketer with a Passion for SEO - Driving Results through Analytics and Optimization