Auto number generation is a common requirement in Dynamics CRM solutions. This blog post demonstrates how auto number generation can be configured in 10 minutes with no code.

This blog post does not discuss the Dynamics CRM out of the box auto number feature as it only works for a small number out of the box entities.

Download Solutions

The first step is to download the Dynamics CRM 2015/2016 Auto number solution from CodePlex. After downloading the Auto number solution, import it into your CRM instance.

Configure the Auto Number

The Dynamics CRM 2015/2016 Auto number solution includes a custom entity titled Counter Configuration. To configure an auto number, create a new Counter Configuration record. I do this by opening the advanced find, selecting Counter Configuration, and click the results button, then click the New Counter Configuration button.

pic1-advanced-find

pic2-list-tools

The below configuration shows an auto number will be generated for the sms_contactreference field on the contact entity. The auto number will be generated with a prefix of I (for individual) and 6 digits for eg. IXXXXXX, I000001, I000002, I000003 and so on. The Next Number field stores the number to be used on the next contact record. Every time a record is created, the Next Number value will be incremented.

pic3-contact

Verify Auto Number Generation

When a new contact is created, the Contact Ref# field is automatically set to the “next” auto number values.

pic4-contact-info