CRM 2011 Autonumbering Solution

Auto numbering features are important in any business application to accomplish some business needs. Same in the CRM application and it needs additional customizations and plugin(or a custom workflow) to be implemented for the entity to statisfy auto numbering requirements. Jaimie Ji has a solution for this in CodePlex and this post is to demonstrate how to get use of Auto Numbering Solution in CRM. Advantage of the solution is that; developers dont need to write seperate plugins for each entity which needs auto numbering and it provides prefix, postfix, starting number and increment by features as well. Also it always open to change the configurations and no need any hard code values.

Unmanaged Solution (

Auto Numbering Solution has a CRM solution and the solution contains one entity called “Counter” to save all the settings for all the counters. If there are two auto numbers in two different entities, just need only two records of this counter entity in the CRM application.

CRM.Plugin.SequenceGenerator is another component of the solution. If the solution doesnt contain the plugin, developers can get the source code from CodePlex, build it and can get the assembly registered in the CRM application manually.

There are some images as utilities to the Counter entity in the solution.

Source Code (

Source code contains the visual studio solution for the plugin. Developers can download the code, buil it and use the assembly for the registration. Plugin registration tool can be used to register the pluging in CRM application. The assembly can be attached to the CRM auto numbering solution and can be exported as a managed solution to be used in some other CRM projects.

Requirement :

Requirement is to generate auto numbers for Students and Courses in an Institute. Student Numbers has a prefix which can be a current year. Courses has a postfix which related to the type of the course.

Demo :

Create a seperate solution for the application (AutoNumberingTesting solution has been created) and create Student and Course Entities.

Student Entity: Auto numbering field is “Student Number” and it is a TextField. This should not be a WholeNumber field as the Numbers can have prefixes and post fixes with it.

Course Entity : Auto numbering field is “Course Number” and it is also a TextField. This should not be a WholeNumber field as the Numbers can have prefixes and post fixes with it.

Publish the AutoNumberingTest soution.

Import the Auto Numbering Solution to the CRM application and publish it.

CRM Solutions

If the CRM.Plugin.SequenceGenerator is not included in the CRM solution just get the source code (, build it and register the plugin using plugin registration tool.

Register two steps as it needs to be triggered at Student and Course entity creations.

CRM.Plugin.SequenceGenerator Plugin

Student Entity Creation Step

Student Creation Step

Course Entity Creation Step

Course Creation Step

Then enter counters for Students and Courses with the following values as follows; Student numbers will be starting from 101 and course numbers from 11 according to the counter settings.


Application is ready to be used and create some student records and course records.


The solution has worked nicely and it reduced the time of writing  new plugins for the CRM application. 🙂

Thanks to Jaimie Ji


3 Replies to “CRM 2011 Autonumbering Solution”

  1. Hi
    Sorry but I have a few problems

    I dont know why did you create ‘AutoNumberingTesting ‘ solution and where did you use it?

    and I dont know where to enter counters values for Students and Courses. In fact I dont know where exactly figure 5 refer to.

  2. I do not write many responses, however i did a few searching and wound
    up here CRM 2011 Autonumbering Solution | I n d i k
    a ‘ s Tech Blog. And I do have some questions for you if it’s allright.
    Could it be simply me or does it look like some of the comments come across like
    written by brain dead people? 😛 And, if you are writing on additional online social sites, I’d like to follow everything fresh you have to post. Could you list of the complete urls of all your public sites like your linkedin profile, Facebook page or twitter feed?

Leave a Reply

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

You are commenting using your 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