In Dynamics / Power Platform at times we require automatically generate auto number for an entity which has the alphanumeric characters. Microsoft offers custom format auto number option as well. In this example let us see for contact entity how this can be achieved to generate automatic Id creation for contact record.
Login to the required environment and go to the required solution where you need to do customizations as shown below figure
After Step 1, select solution and navigate to contact entity and then click on add column and provide Display name as Tag Id and Name as tagid and under datatype select Autonumber type as shown in the below figure
After Step 2, we can provide Autonumber type as String prefixed number or Date prefixed number or Custom so in this example I have selected String prefixed number and provided
Prefix – ID
Minimum number of digits – 6
Seed Value – 100000
And click on Done and Save tableas shown in the below figure
After Step 3, search for the field Tag Id and you should see it in the list of created columnsas shown in the below figure
After Step 4, add created Tag Id column in Contact Entity Main Form by navigating to Contact Entity Main Form and place Tag Id column inside and make it as read-only and click on Save and Publish
After Step 5, Go back to solution and publish all customizations as shown in the below figure
After Step 6, Go to Contact entity(table) and create new contact record and observe that Tag Id column is automatically populated as shown in the below figure
- Make sure auto number data type is selected.
- Specify format as per the business requirement.
- Publish All Customizations without fail as specified in Step 6.
Conclusion: In this way, one can easily use auto number data type for a given field in Dynamics CRM