Now let's write a plugin to generate an auto ID. Generating an auto ID in Microsoft CRM is a very common requirement. So we are going to write a generic plugin to generate an auto ID for any entity. We have created an Auto ID Setup entity, which we will use to create the entity record for which we need to generate an auto ID. We will specify the entity name and auto ID field name, and we will use this information in our plugin to set the auto ID.
First we will create an Auto ID Setup entity record that will provide an entity name, auto ID field, and start number for generating an issue ID. Create an auto ID setup record and enter the following information: