Is it possible to have different prefixes on the same table?

Jason Parsons
Tera Contributor

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!

3 REPLIES 3

Pavankumar_1
Mega Patron

Hi @Jason Parsons ,

No we can't have 2 prefixes for same table.

Refer below

https://www.servicenow.com/community/itsm-forum/can-two-prefixes-be-added-to-incident-table/m-p/5323....

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0694571

If it helps please click Accept as Solution/hit the Thumb Icon.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar

BharathChintala
Mega Sage

@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.

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

Pavankumar_1
Mega Patron

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);

 

If it helps please click Accept as Solution/hit the Thumb Icon.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar