Fix for duplicate number from multiple table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-12-2023 10:41 AM
I am using 3 tables. 1 parent table and 2 child tables. The 2 child tables are inheriting the same numbering format as the parent so when a ticket is created from child table, that same ticket shows in the parent table.If you're viewing the list from the parent table, all the tickets are there. Also, if you are view the list from each child table, only the tickets that were opened for that table is displayed.
The issue I am having now is, there are duplicate numbers in the table. A ticket from the child table has the same ticket created from parent table even though both tickets are different.
Can someone provide a fix for my issue?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-15-2023 09:07 PM
Do you have number field in child table with same sequencing of parent?
Bharath Chintala
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-15-2023 09:59 PM
The child table is using the parent tables number format
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-15-2023 10:26 PM - edited ‎01-15-2023 10:28 PM
You have two options
one having only one table move all child data to parent table then run a fix script to fix all numbers as below
var inc = ‘INC’;
var num = ‘100000’;
var gr = new GlideRecord(‘incident’);//replace your table
gr.query();
while(gr.next()){
num= num+1;
gr.number = inc + num;
gr.update();
}
second option
goto parent table
auto number checked
Give series like INC OR CSM
Select number start from 0
total digits 6
so number will be INC000000, INC000001
now go to child table 1
auto number checked
Give series same like parent
Select number start from 300000
total digits 6
so number will be INC300000, INC300001
now go to child table 2
auto number checked
Give series same like parent
Select number start from 600000
total digits 6
so number will be INC600000, INC600001
then run 3 fix script for each table to auto number one time
note: if you feel there is chance of you will have more than 3lakh records give second table number from there and same with third alao
Bharath Chintala
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-15-2023 10:56 PM
Hi,
Even if I set child table 1 to 300000 and child table 2 to 600000, wouldn’t those 2 child tables eventually run into dups eventually? Even parent table will run into dups with the child tables eventually right?