- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2022 02:31 AM
My current requirement is to change number prefix on a custom table say "DOC" to "NO". Will the changes be applied to existing records as well?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2022 02:34 AM
Hello,
Go to Number mantainence table and find entry for your table and make changes, It will affect new records, it won't reflect in existing records. You have to run background script or fix script to change prefix of existing records. Please see below link
https://servicenowguru.com/scripting/changing-number-prefix-existing-records/
Also Number maintaince table link:
https://yourinstance/nav_to.do?uri=%2Fsys_number_list.do%3Fsysparm_userpref_module%3D10e86ef3c61122750035cf9c7f4d00dc%26sysparm_clear_stack%3Dtrue
Regards
Regards,
Musab

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2022 02:34 AM
Hello,
Go to Number mantainence table and find entry for your table and make changes, It will affect new records, it won't reflect in existing records. You have to run background script or fix script to change prefix of existing records. Please see below link
https://servicenowguru.com/scripting/changing-number-prefix-existing-records/
Also Number maintaince table link:
https://yourinstance/nav_to.do?uri=%2Fsys_number_list.do%3Fsysparm_userpref_module%3D10e86ef3c61122750035cf9c7f4d00dc%26sysparm_clear_stack%3Dtrue
Regards
Regards,
Musab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2022 02:37 AM
Hello
for changing the prefix you can follow below steps
Go to number maintainance
Search for you table and update it
You would have to write a fix script to update the number for the existing records .It will only be applicable to new records like below
Replace your number field back end name in below script
var gr = new GlideRecord('your custom table name');
gr.query();
while(gr.next())
{
var number = gr.number.split('DOC'); // replace your number field back end name
var splt = 'NO'+number[1];
gr.number=splt;// replace your number field back end name
gr.update();
}
please mark my answer correct if it helps you