Make a new field auto numbered
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-20-2017 06:22 AM
Is it possible to have two fields in one table be auto numbered?
On Incident table, there is a number field which is auto numbered already.
Now I have created one more field (on same table)which also needs to be auto numbered on every update happened on the incident form.
Any help will be appreciated 🙂

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-20-2017 08:04 AM
e.g When incident is created, MessageNumber =1. If any update happened on that incident, then MessageNumber =2.
Another incident is created, then MessageNumber =3 like that.
So after 2nd incident is created you would like to set MessageNumber to 3 that is fine. SO what if someone updates the 1st incident?
Would you like to overwrite MessageNumber value from 2 to 4?
If that is the case you will never know where you started and in my opinion the MessageNumber value will not provide you any helpful metric.
Can you tell us business case?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-20-2017 10:02 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2017 04:58 AM
Write a before insert, update business rule and udpate the script provided by @sharique
var gr= new GlideRecord('incident'); //say my table is incident..
gr.orderByDesc('u_messagenumber');
gr.setLimit(1)
gr.query();
if(gr.next()){
var str_i = parseInt(gr.u_messagenumber);
str_i++;
current.u_messagenumber = str_i
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-20-2017 06:34 AM
Sayali, are you trying to determine how many updates are occurring on a task? If so, there is an out of the box field on task called Updates (sys_mod_count) that increments on every update.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-20-2017 06:45 AM
Hi Michael,
I dont want to record an updates. I have replied above with my full requirement.