News Ticker

Auto Numbering Solution for CRM 2013 Online


A number of times we come across a requirement to create a auto-incremental number for a variety of records in Dynamics CRM. The usual solution for this scenario has been developing a synchronous plug-in to generate an auto-incremental number and then assign to the record. Any solution involving developmental work has been costly to the customer and been subject of heavy testing activities because of risk involved with custom code.

Using CRM 2013 Synchronous workflows, auto-incremental numbers can be achieved without writing a single line of code. Some of custom auto-incremental solutions uses SQL table’s IDENTITY Columns or SQL 2012’s SEQUENCE feature and makes the solution difficult to deploy in a Dynamics CRM 2013 Online deployment.

Here I would discuss a solution which is completely native to Dynamics CRM and hence easy to deploy in CRM 2013 Online deployments. Follow the below steps to create an auto numbering solution for any entity, for example a CONTACT ID.

 Step 1: Create an entity “Auto Number Definition”.

Auto Number Definition

Step 2: Create the following fields for Auto Number Definition entity.

Auto Number Definition Fields

Step 3: Create another entity “Auto Number Request”.

Auto Number Request

Step 4: Create the following fields for Auto Number Request entity.

Auto Number Request Fields

The idea here is to create an Auto Number Request record with every Contact record creation and Auto Number Request will generate a New Number using an Auto Number Definition record. The New Number would then be copied to the Contact record.

Auto Numbering Process Steps

Step 5: Create a synchronous workflow on Auto Number Request entity.

Auto Number Request Create Workflow

Step 6: Create a Auto Number Definition Record for the contact entity.

Auto Number for Contact Record

Step 7: Create another synchronous workflow on Contact entity.

Contact Auto Number Workflow

About Dipankar Bhattacharya (59 Articles)
A multi-skilled Dynamics 365 Professional with strong experience in delivering IT projects especially across multiple industries. A Microsoft technology evangelist, a regular speaker at tech events, blogger and avid reader. Certified IT Architect and well versed in Solution Architecture of Business Applications using Microsoft platforms like Dynamics 365, Azure and Office 365.

9 Comments on Auto Numbering Solution for CRM 2013 Online

  1. Hi, Dipankar

    I tried all the steps but when i am creating new contact.. No 1 is repeated. and not auto-incremental number.

    Regards,
    Sandeep

  2. Hi, This is looking good compared to most approaches that i have taken for Dynamics CRM online. Can you just expand on what you mean by: Step 6: Create a Auto Number Definition Record for the contact entity.

    I am not quite sure how to do this step although the rest has been very clear.

    Many thanks,

    Ross

    • Step 6 suggests to create a new record of Auto Number Definition using the values specified.

      • I have completed all the given process above but I could not get auto number generated on my contact form i.e ID and also Auto number request new record is also not being created.
        I know somewhere I must be missing something.I tried to create the above given process twice or thrice but no improvement!!
        Any help is welcomed

  3. Will this work in 2011?

  4. hi step 6 values specified means in the new reacord we have to keep the fields such as increament,lastnumber i cant understood pls clarify

  5. if it is we have to specify the same fields then we have to creat them in global set otherwise how we can get the same fields into other entity(here contact)

2 Trackbacks / Pingbacks

  1. A working Incremental Number ID Solution (with different prefix’s) using Syncronous Workflows - Microsoft Dynamics CRM Community
  2. Creating readable unique identifiers for your CRM records | Salim Adamon - Dynamics CRM Blog

Leave a Reply

Fill in your details below or click an icon to log in:

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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: