Duplicate number created while creating record

harry24
Tera Contributor

Duplicate number created while creating record , even though the auto numbering feature is on

8 REPLIES 8

Shruti Khaire
Kilo Sage

Hello @harry24,

This can happen on any of the task tables and it needs to be fixed very quickly as it might affect lot of reporting as well. 

The unique identifier for all records, including duplicate records in ServiceNow, is the respective sys_id generated by the system. By default, ServiceNow does not enforce uniqueness on the task.number column. This opens the possibility of having records with the same number.

 

Probable Reason for this to occur :

  • Reason 1:
    The issue can occur from multiple pushes being made to the submit button. Although generally this is in conjunction with a network latency issue (i.e. where a push is sent and upon reconnection, another push is sent separately), it can simply occur without.
  • Reason 2:
    One possibility is if there is a double insert caused by a business rule that contains a current.update or an .update when the record is inserted.
  • Reason 3:
    One scenario is where you cloned over from production and production already have that number.

Solution Proposed

As of now, unless there is a way to reproduce this issue, or if there is some type of pattern of the issue, it would be difficult to pin point what may cause the issue.

The best way to resolve this issue is:

  • To impose the unique numbering on task table via a Business rule so that duplicate numbers will not be created. Before every update, it will make sure that a new number is assigned to the record.


OR

  • Enable a unique index on the table.
    Note: While unique indexes ensure data integrity they also prevent any insert involving a duplicate number. This may cause unexpected errors during data entry.

Hope this helps, thank you!

How to enable unique index? can you help me 

Hello @harry24,


You can select the unique field checkbox by configuring the required column and then check the same to make sure number field has unique values always when submitting new records.

ShrutiKhaire_0-1701349967002.png

 

Hope that helps, thank you!

 

unable to activate unique index as there are already duplicate records with same number , any solution to assign unique numbers to existing records