Auto increment

ad14
Tera Contributor

I have loaded some data one instance to another instance. I did the export xml and import xml to transfer all the records of  a table. That table has the field ‘number’ which is auto incremented. My problem is after the import when I manually create a new record a duplicate number is created. The number is being created from the starting value like 001. How to prevent that. 

3 REPLIES 3

GlideFather
Tera Patron

Try to check the number maintenance:

KamilT_0-1752826017637.png


But the Number uniqueness might be enforced by BR so when you create a new record manually it is checked but for the import it might be skipped.

How many records do you have?

PS: it makes perfect sense that moving records from one instance to another has different records under the same number as there are differently created..

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */


Chaitanya ILCR
Mega Patron

Hi @ad14 ,

 

Ideally Before Insert BR can be created to check if there is already a record with same number exists or not and if the number exists add +1 to the number

 

but is it task data? if yes It's not recommended to import that data in to the higher instances

 

how often do you perform this activity? import of xml data?

 

if it is one time you can go to sys_number_counter table and adjust the counter related to your table after/before the import is complete

 

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @ad14 

Is this related to Incident or Knowledge Base (KB)? I believe it might still be expected behavior for KB, but I’ve never heard of such a case with Incident. Please check the auto-numbering configuration in the target instance.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************