AUTO NUMBER Solution with preceding zeros in Dynamics 365 - Workflow Step

Easy, no code, auto numbering for Microsoft Dynamics Online with Prefix, Suffix, and preceding zeros option! Works with any entity, custom or out-of-the-box

Example: L0001D, Loan#00001, P0310


Step 1 - Download the Solution

Download the solution from the Clark & Ali Github


Step 2 - Upload the Solution Zip file into your Dynamics 365 environment





Click on Settings, and then select Solutions










Click on Import









Choose the Zip file, click Next and then Click Import

Wait for the import to finish




Step 3 - Configure the Solution

Refresh your page, Click on the Menu, and select Settings

You should now have a Clark & Ali Dev Tools Group with an Entity called Auto Number Config inside it.

Click on this entity

Click new in the top left corner to create an Auto Number Config Record

You should see a record that looks like the image below

Fill out the record according to the suggestions below

Basic Configuration:

  1. Replace "Entity" with the name of the Entity where you will use Clark & Ali's Auto Number Tool. I am going to use my "Loans" Example Entity

  2. Add a prefix like "L". A value is not required and you can have as many characters as you would like.

  3. The Seed Value has a default of 1, but can be changed to start at any value.

  4. Add a Suffix like "D". A value is not required and you can have as many characters as you would like.

  5. You can click save now if you like, or I recommend the advanced configuration below, preceding zeros look much better than leaving it in the basic configuration

At this point your Auto Number ID would appear as L1D, assuming you configure the workflow in Step 5. After the creation of a second record it would show L2D.


Advanced Configuration: Add preceding Zeros or another character [Before or After Prefix]

1. Change Advance Configuration to Yes (Pretty much all you need to do for this section)

2. By default the # of Digits is set to 4. 4 digits will return 0001, Example: L0001D, L0002D, L0003D... etc. If you want your ID to look like L00001D, pick 5.

3. By default the Placement of Value is "After Prefix". If you change it to before, Example: 0001LD.

4. By default the Digit Value is 0 and I would leave this as 0. If you change this to 1, Example: L1111D, if you use X, it would be LXXX1D.

5. Click Save


Step 5 - Create the N:1 relationship between your entity and the configuration entity

Click on Settings, and select Customizations

From the Menu, select "Customize the System"

From the Menu on the left, Click the Entity drop down, Navigate to the Entity you would like to show your Auto Number inside, click the drop down next to it and find "N:1 Relationships" like the image below

Click on New Many-to-1 Relationship

From the Primary Entity drop down, Choose "Configuration Entity"

Under the lookup section, fill in the Display Name with Configuration Entity

Click Save and Close

Normally I adjust the "Name" to configuration_loans, but honestly it does not matter


Step 6 - Create and configure the workflow


Below the Entities drop down, select Processes

Click New to create a new workflow process

















1. Process Name: Name the Workflow, I name my workflows as follows, [Entity:Purpose]

2. Category: Choose Workflow

3. Entity: Choose the entity where you will use autonumber

4. Make sure "Run this workflow in the background" is unchecked

Make sure "New blank process" is selected

Click OK

Make sure that under the options for automatic processes has "Record is created" checked off, it should have this by default

Click Add Step, Select DevToolsWF (1.0.0.0), and then click DevToolsWF.AutoNumber

When the workflow step appears, click Set Properties

Click on the small magnification icon under the value column

Select Auto Number Configuration for "Entity"

Yours may be named differently, this name comes from the Configuration record you created in step 3

Click Save and Close

Click Add Step again, and select Update Record




















When the Update Record workflow step appears, make sure that the entity you would like the autonumber to be in appears on the workflow step, click Set properties

Click the field where you would like the autonumber to appear

Click first dropdown under "Look for:" and select DevToolsWF.AutoNumber


Click Add and then select OK

Yellow highlighted text should appear in the field, see the image below

Click Save and Close

Click Save on the Workflow form and then click Activate, Click Activate again on the pop up window

You're all setup, but please contact us if you have any issues configuring any of the steps mentioned above. We want to produce the best solutions possible and need feedback to do so! Please leave a comment and let us know if you want to have additional customization abilities or a simple "it works"!


Thank you


© 2023 by Clark and Ali

  • LinkedIn Social Icon