Is it possible to have different prefixes on the same table?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2023 05:37 AM - edited 02-17-2023 05:38 AM
Basically just the title, my company would like to use specifically the Knowledge base, but possibly some other tables, for a few different things that they would like to have different prefixing, similar to our old tool. So for example, with the knowledge base, if it is part of the "How To" knowledge base, the prefix might be HTO, while if its an installation guide, it would be ING or something like that, basically just different prefixes based on one of the fields.
From what I am seeing searching it up myself, it can only be done to an entire table, not select records, but I would like to confirm here if possible. Thank you in advance for any and all help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2023 06:44 AM
Hi @Jason Parsons ,
No we can't have 2 prefixes for same table.
Refer below
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0694571
ServiceNow Community MVP 2024.
Thanks,
Pavankumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2023 06:53 AM
@Jason Parsons create a new table extending the table you want to have 2 prefix. In new table give the prefix you want.
Now what ever you create will be available in table one also like this you can have 2 prefix in one table.
Bharath Chintala
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2023 07:21 AM
Hi @Jason Parsons ,
If you need to implement this functionality the you can create before insert business rule on your table and use below script. This second auto number available after successful insertion only.
Below script works for display business rule as well.
(function executeRule(current, previous /*null when async*/ ) {
var num = current.u_number; //add your auto number field name
var newNum = num.replace('ORD', ''); //give auto number prefix
var newPrefix = 'MORD' + newNum; //will get the new prefix
current.u_custom_number = newPrefix; //update new prefix on your field
})(current, previous);
ServiceNow Community MVP 2024.
Thanks,
Pavankumar