Creating an auto-numbering field in dynamics 365 using workflow

May 31, 2019

In this blog we will cover how to create identification auto-generated field using simple real-time workflow. This can be created for any entity (even for a custom entity). For this you must follow these simple 3 steps: 

  1. Create a custom auto number entity 
  2. Creating a relationship between the created custom entity and the entity that will have the auto-numbering field. 
  3. Make a real-time workflow to populate and increment the number. 

Here are the steps in detail to create the custom auto-generated field. We will be creating the field in few entities which will end up with an automatically generated number with an optional prefix and suffix on the first save of the record. 

1. Create & save your solution:

create auto numbering field in dynamics 365

2. Add the entities you would like to add the auto number functionality to 

Create auto number Accounts, Quotes, and a custom entity created called Projects. 

how to create auto numbering field in dynamics 365

3. Create a new entity called AutoNumber

auto numbering

4. Add the following fields to the AutoNumber form for each entity you would like to have auto numbering. 

  • Prefix (Text) 
  • Suffix (Text) 
  • Number (Whole Number, Simple) 
  • Increment (Whole Number, Simple) 
dynamics 365 fields

5. Create a 1: N relationship between your AutoNumber entity and the entity you would like to have the auto number functionality applied to

relationship

6. Create your AutoNumber form: 

Create a section for each entity you would like to auto number 

AutoNumber form

7. Add a text field to each of the entities you would like to auto number 

This will store the generated number.  In this case, we have called mine Account Number. 

text-fields

8. Create the AutoNumber record with the default values in it 

  • Go to advanced find 
  • In “look for” select AutoNumbers 
  • Click results 
  • Click New AutoNumber 
  • Enter in your values 
records

9. Now create the workflow to set and update the AutoNumber (one for each entity)

create workflow

10. Create a step to update the quote and set the Quote AutoNumber lookup to the value of the record you created (Defaults)

quote-auto-number

11. Update the value to your quote number field on the quote form using the AutoNumber values:

values

12. Increment the Quote AutoNumber number field by the amount in the quote increment field

increment- create auto numbering field in dynamics 365

13. Leaving you with a Workflow looking like this Repeat it for each entity you would like to Auto number.

workflow- create auto numbering field in dynamics 365

Now create some records and you should have some automatically generated numbers! 

We will be compiling more similar blogs on other modules as well. Do subscribe to our blog to get the latest updates directly to your inbox. If you need help creating an auto-numbering field in dynamics 365, Contact us today for a no-obligation consultation on 01296 328 689. Or email us at info@dogmagroup.co.uk.