Dynamics CRMCustom Auto Number for Cases

Currently in Microsoft Dynamics CRM, customer service representative creates a case to track a customer request, question, or a problem. All actions and communications can be tracked in the case entity. ID field in Case entity is automatically generated and default format is CAS-00034-Z7M9F7. This kind of Case ID will not be meaningful for many users and there might be a need to create an ID which consists of customer name so that service representative can easily identify the case just by looking at the Case ID.

In today’s blog, we will show you how to generate customized Case ID with your own format as per the business requirement.

Whenever a case is created Case ID field is automatically generated and lock is acquired on that field. User cannot change the ID generated. In order to achieve a custom generated Case ID we create a plug-in and do customizations in CRM. Here we are considering an example where Account entity is been used. The Case ID generated is like “3-003” where ‘3’ is the unique account number and ‘003’ represents the 3rd case for respective account. When 4th case is created on same account, the counter increases and the Case ID generated will be “3-004”. Thus track can be maintained on cases for different accounts just by seeing the Case ID.

In order to get Custom Auto Number on Case Entity follow the below steps:

2) Customizations in CRM

Add Counter field to the entity whose values you will use in Case ID.

Initialize the counter field to 0

Hide the counter field.

Example
We can consider an example where case number is generated through plugin. Requirement is to create Case Number with respect to the account selected. Whenever a new case is created on that particular account, counter increases and case Id is generated.

Create an account with name “Anay Industries”.

Account number- Unique identifier for account created.

Case Counter- By default it is set as 0. This is hidden field and whenever a new case is created the counter increases by 1.

Case ‘Auto number generation’ is created with Customer “Anay Industries”
Anay Industries has Account Number- 3 and Case counter-2. When this case is created Account Number is selected and counter is increased by 1.

When the record is created Case ID “3-003” is generated where ‘3’ is the Account Number and ‘003’ is the case counter.

Conclusion

Although our example was simple, you can generate complex case numbers as well by applying a different logic.

We hope this have given you a useful information on generating automated Custom Case Number.