Number Maintenance - Auto-Numbering Records

mferich
ServiceNow Employee
ServiceNow Employee

I know it is possible to set auto-numbering format as the prefix for new table records (such as INC for incidents or CHG for changes), but is it also possible to establish an auto-numbering suffix format?

 

For example: I want all new incident records to end in the suffix MAY (for the current month). Thus, when a new incident is created, the record is entered into the table with the number INC10001MAY. The next new incident contains the number INC10002MAY, followed by INC10003MAY, etc.

 

Thank you in advance!

1 ACCEPTED SOLUTION

Bhavesh Jain1
Giga Guru

Code :



var gdt =new GlideDateTime();//December


var month = '';


gs.print(gdt.getMonth());


if(gdt.getMonth() == 12)


month = 'DEC';


current.number = current.number + month;


View solution in original post

6 REPLIES 6

Bhavesh Jain1
Giga Guru

Yes it is very simple.


Write a business rule ON BEFORE insert on incident table and make the necessary changes to the number field as per the calendar month.




Regards,


Bhavesh


IGate-logo.png


http://www.igate.com


Hello Bhavesh,



Thank you for the prompt response - I am glad to hear the solution is quite simple!



Best,


Myles


Please mark the answer as correct if it solves your problem.


Bhavesh Jain1
Giga Guru

Code :



var gdt =new GlideDateTime();//December


var month = '';


gs.print(gdt.getMonth());


if(gdt.getMonth() == 12)


month = 'DEC';


current.number = current.number + month;