We imported 3,500 historical service cases from our legacy system using Dataflow, and now our auto-numbering sequence for new cases is generating duplicate case numbers. The import completed successfully and all historical cases have their original case numbers (format: CASE-YYYY-####). However, when agents create new cases through the D365 interface, the system is assigning numbers that already exist in the imported data.
Our auto-numbering configuration uses a custom plugin that generates case numbers based on the pattern CASE-2025-0001, CASE-2025-0002, etc. The plugin worked perfectly before the bulk import - it would query the last case number and increment by one. After the import, we’re seeing errors like this:
Duplicate key violation: Cannot insert duplicate key in object 'dbo.IncidentBase'.
The duplicate key value is (CASE-2025-0847).
It seems the plugin’s logic for determining the next sequence number isn’t accounting for the imported historical cases. The plugin queries for the maximum case number but maybe the bulk import bypassed the normal auto-numbering sequence management. We need to fix this quickly because agents are having to manually retry case creation multiple times, and we’re worried about data integrity issues with the duplicate attempts.