flexible autonumber solution for Dynamics 365/ CDS with uniqueness guaranteed

Follow my blog for more interesting topics on Dynamics 365, Portals and Power Platform. For training and consulting, write to us at info@xrmforyou.com

I am pleased to announce the new Auto Number tool from the stable of XrmForYou.com.

Before I walk you through all the features and how you can use the tool to your benefit, the eternal question, why again a new tool for an old requirement? Agreed it’s a requirement which every company implementing CRM must had at some point during their implementation lifecycle. And yes there a whole lot of solutions available which are targeted for that as well.

However, there are usually the following limitations I have faced while using many of the solutions

  • Not all generates unique numbers. Specially in case of data migration and during bulk uploads.
  • Many solutions uses Mutex lock. Even that does not guarantee uniqueness. And not an ideal solution for Online.
  • Many lack a good configuration page. Setting up an entity and field for an entity for auto number configuration is something you need to do manually many of the time
  • And last but not the least, how much a solution burns your pocket. You have impressive solutions in the market which covers all but perhaps you back down from implementing them because of budget constraints. We have tried to make this solution affordable as much as possible.

We have tried to cover up most of these scenarios and we hope you would find it useful for your business.

For trial and pricing, please write to info@xrmforyou.com

So let’s jump to the documentation.

The tool comes in the form of managed solution. Once you install the managed solution, open the configuration page.


Select an entity from the drop down. For my example, I selected Contact entity. Once you select the entity, all the ‘String’ and simple ‘Whole  Number’ fields would be populated for the selected entity.


For my example, I have created a String field ‘Auto Number Field’ which I will be using for the Auto Number.

I select the field.

I will explain the other options visible in this screen.

  • Disable configuration – By default, auto number configuration is enabled automatically once you select an entity and save your configurations in the tool. However you may choose to just disable the auto number for that entity without actually deleting your configurations that you took so much time to set-up.
  • Starting Number – By default it is set to 1. You can change it as required
  • Next Number – This field is for display purposes only and shows what number would be there in the next record that would be created. You can always reset the  ‘Next Number’ to the ‘Starting number’ by click on the ‘Reset Next Number’ button. 
  • Increment By – This field is used to determine by how much will the next number increment for the next record. You can set it to as desired. By default it is set to 1.


You have an option to choose a prefix value for you Auto Number. For that, just need check the checkbox ‘Insert Prefix’.

Once you check that you get the below options.


  • Prefix Value – Since I am using Contact entity, say for example I prefer my auto number value to be prefixed with C000. You can just put this value in the prefix.
  • Prefix Separator – Suppose I want that my auto number value and prefix value should be separated by a symbol. You can choose your desired list from the symbols provided in the dropdown. I have selected Hyphen(-) in my case.

P.S – If the field you have selected for Auto Number configuration is of type Whole Number, then prefix and suffix options will not be visible. Just for example – I have selected No. of Children which is of type Whole Number. Hence you could not see Insert Prefix & Insert Suffix Options.



The next option you have is to have a suffix appended to your auto number. For suffix, the tool provides you a whole lot of options. Let’s explore them


  • Suffix Generation Method – The first option you get is the Suffix Generation Method which can have two values
    • Auto Generated – If you select this option, you would see two additional fields showing up.
      • Suffix Length – The length of the suffix value
      • Suffix Type – You can choose between Whole Number & Alpha Numeric depending on the business requirement. Please note that you would have no control on the number generated. All the system would guarantee that it won’t be more than the length specified in the ‘Suffix Length’ field.


    • Manual – If you select this option, you would get the below option
      • Suffix Value– It’s a fixed value that you want to show for the suffix.


  • Suffix Separator – Same as explained for Prefix separator.

For my example  I have chosen Suffix Generation Method = “Auto Generated” & Suffix Separator = “At symbol(@)”

My final settings screenshot.


I click on Save to save my configurations.

Now let’s see, how an auto number is generated.

I create a new contact record and below is the auto number I get.


If you remember the I have selected alphanumeric for my suffix and put the suffix length – 5. that’s why the suffix is generated as a combination of numbers and characters of length 5.

This tool would give generated unique number for manual creation, bulk-imports or through data migration.

Last but not the least. The solutions comes with a security role – ‘Auto Number Reader’. Please make sure that all users using the the Auto Number are provided that role. Otherwise users other than system administrators would get the access error.

For trial and pricing, please write to info@xrmforyou.com

Debajit Dutta

(Business Solutions MVP)

Try our tools

Sharepoint Metadata Manager and Attachment Extractor (http://www.xrmforyou.com/sharepoint-integrator-1.html)

Role Based Views in Dynamics CRM (http://www.xrmforyou.com/role-based-views.html)

Multiselect Picklist Control (http://www.xrmforyou.com/multi-select-picklist.html)

Record Cloner (http://www.xrmforyou.com/record-cloner.html)