java.sql.BatchUpdateException "Duplicate entry for key" error

Tony Flower
Tera Contributor

We have a custom number field on the cmdb_ci table that uses get next number padded. We have a before insert business rule to change the number if is already in use which does happen sometimes.

We've just started to use Service Builder app. We can create services and service offering with it, but when we try to update a service, we get this error from the service offerings.  Any ideas?

 

TonyFlower_0-1690203009340.png

 

 

 

 

 

 

1 ACCEPTED SOLUTION

Philip Green
Mega Guru

That error is due to the field producing the exception being marked 'unique' in the dictionary. Note that if you mark a field unique, you cannot simply unmark it afterwards - the back end database may continue to process it as unique and you will need ServiceNow support to make a change to the back end database to correct this.

View solution in original post

1 REPLY 1

Philip Green
Mega Guru

That error is due to the field producing the exception being marked 'unique' in the dictionary. Note that if you mark a field unique, you cannot simply unmark it afterwards - the back end database may continue to process it as unique and you will need ServiceNow support to make a change to the back end database to correct this.