Dynamics 365 v9.0 Hidden Gems – #1 Autonumber

The Dynamics 365 v9.0 for the online deployment has become available since a few days ago. I believe we are all excited with this new release. There are major improvements in a lot of areas such as the unified client (a.k.a refreshed UI and great potential ahead), platform enhancements (Virtual Entities, Microsoft Flow integration directly from Dynamics 365), Hubs – this was the Interactive Service Hubs, being extended for other modules (Sales, Service, Project Service, Field Service) and many more.

Yet, there are few hidden gems that can be uncovered from the v9.0 update that could be a life saver in the Dynamics 365 projects. I’m starting the v9.0 Hidden Gems series to run through the hidden gems. I’m going to start with the first one: Autonumber. And no, this is not the same Autonumber that is available for some of the out of the box entities like case, invoice, order, etc

not the autonumber.png

This feature was announced by Matt Barbour at Microsoft Ignite Conference, the recording is available at this Youtube video. At this moment, this feature is available from the API only and there is no explicit documentation available yet.

At high level, this Autonumber features could generate the number with below features:

  • Date format
    • Syntax: {DATETIMEUTC:[format]}
  • Sequential Numbers
    • Syntax: {SEQNUM:size}
  • Random String
    • Syntax: {RANDSTRING:6}
  • Static string
    • Any string component that is not using the above syntax will be treated as static string.

Sample code snippet from Matt’s presentation:

Autonumber code snippet.png

Given at this moment the documentation is not available yet and it is only available via the API, this is a bit tricky for Admins/System Customisers to work on this feature. Luckily, the Dynamics 365 community is really reactive to this and there are few helper tools available.

Option 1: AutoNumManager – XrmToolBox Plugin by Jonas Rapp

ANM-screen.jpg

You can read the instruction on how to use it at: http://anm.xrmtoolbox.com/ and download the plugin from GitHub: https://github.com/rappen/AutoNumManager/releases

Option 2: Easy AutoNumber by Dimitri Chevkov

Another option if you would like to configure the Autonumber from the Dynamics 365 itself. This solution is provided as Dynamics 365 managed solution: https://dynamics365heroes.com/2017/10/02/easy-autonumber-utility-dynamics-365-july-2017-update-v9/

easyautoscreen.png

Findings

So, I’ve tried the Autonumber features and would like to share some of my findings here:

  1. This autonumber attributes apparently more robust from the Workflow/Plugins workarounds that some people might have developed. It could handle a good degree of parallelism. My PoC was using KingswaySoft to load 5k contact records with bulk operation enabled and using balanced data distributor to do 2 parallel runs. I cannot find any duplicate number with this testing. While the other Workflow/Plugins workarounds produced duplicate records on Dynamics 365 Online environment.
  2. A common question that often been asked by customers: can we specify the starting number? The answer is yes. I looked at Jonas’ XrmToolBox plugin and there is a field to fill in called “Seed”. Here you can specify the starting number for the sequence. Note: from Jonas’ blog post, modifying Seed could potentially generate duplicate numbers.
  3. Multiple Number Sequence within a single Autonumber field is not possible. It seems it is using the same “counter”.
  4. It could not refer to other values within the entity or related entity, where some of autonumber requirements asked for the number to be sequential based on the parent entity. E.g: Custom Case numbering with parent child case, where the child case should use the parent case number as prefix and add the sequence at the end).
  5. At this moment there is no known way to update existing “bespoke” autonumber fields to use this autonumber feature. I read Jonas’ experiment and it seems there are some placeholders within the entity metadata where the autonumber definition is stored. And it seems a bit risky to re-engineer the existing field with something new. If organisations would like to leverage this new autonumber feature, they might consider using a new field, which might impact existing reporting/integration.

HTH!

 

7 thoughts on “Dynamics 365 v9.0 Hidden Gems – #1 Autonumber

  1. Hi Andre,
    Can we use this feature to create auto numbers based on a flag? E.g. we want to have auto numbers set only for certain type of Contacts. Not for all. We have a flag to identify this.
    Thanks
    Sachith

  2. Seed is not working when migrating the field from one instance to another if SEQNUM:6 then it always start in next environment after migrating solution from 001000. is there any way to resolve this

    • Seed is not solution aware, you might need to readjust the seed in the next environment. Here is an excerpt from Jonas’ finding: Note that setting the seed only changes the current number value for the specified attribute. It does not imply a common start value for the attribute. Thus the seed is not solution aware to be transported between environments. To set the starting number after a solution import, the `SetAutoNumberSeedRequest` must be called in the target environment.

    • Hi Lukasz.

      I haven’t tried with the offline sync. Sequence might be skewed on the offline scenario, where the actual request is happening when it’s syncing to the server. Duplicates I think will less likely to happen, as the sync is happened after the fact.

  3. I am doing a POC on auto number capability. I found one issue with that. If a record creation is failed even then autonumber is incremented. It should not happen.
    Just imagine a scenario where a bulk creation fails and auto number increments to several thousands

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s