- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2014 10:01 PM
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!
Solved! Go to Solution.
- Labels:
-
Incident Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2014 10:08 PM
Code :
var gdt =new GlideDateTime();//December
var month = '';
gs.print(gdt.getMonth());
if(gdt.getMonth() == 12)
month = 'DEC';
current.number = current.number + month;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2014 10:17 PM
Hi,
There are two ways to suffix to the number.
Option 1: Modify OOB Global Business Rule "getNextObjNumberPadded" which generates number.
Option 2: Create display business rule on incident table. Please refer below script for your reference:
Condition : current.isNewRecord()
var gdt =new GlideDateTime();//December
var month = '';
if(gdt.getMonth() == 12)
month = 'DEC';
current.number = current.number + month;
Please mark answer as correct/helpful, if it was really helpful 🙂
Regards,
Solutioner
Enhance Knowledge NOW@ www.solutioningnow.com
http://www.solutioningnow.com/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2014 01:45 AM
using below BR to capture month from sys_created_on field of incident table. but no results.
BR: before /insert/ update:
script:
var date = getDate(current.sys_created_on);
var month = date.getMonth();
current.u_months = month;
gs.addInfoMessage(month);
[can't see addInfoMessage ]