Fix for duplicate number from multiple table

Pat Surtan
Tera Expert

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?

8 REPLIES 8

Do you have number field in child table with same sequencing of parent?

If my inputs have helped with your question, please mark my answer as accepted solution, and give a thumb up.
Bharath Chintala

The child table is using the parent tables number format

@Pat Surtan 

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

 

 

If my inputs have helped with your question, please mark my answer as accepted solution, and give a thumb up.
Bharath Chintala

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?