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 06:42 AM
Hi Sayali,
I am not sure if you can put two entries for same table.
So maybe you use after insert br to find the last updated custom number and increment it by 1.
script could be something like
var gr= new GlideRecord('incident'); //say my table is incident..
gr.orderByDesc('number');
gr.query();
if(gr.next()){
var num= gr.field_name;
var str= num.substring(3); //say the field number is NUM0000123, so ill delete NUM
var str_i = parseInt(str);
str_i++;
current.field_name="NUM"+str_i;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-20-2017 10:57 PM
Hi Shariq,
The above script does not satisfy my requirement
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-02-2020 03:37 AM
hi, but the op of this is NUM3 how can we get the full NUM0000123 +1?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-17-2018 10:48 PM
Please try display BR and write below script in advanced condition.
current.field_name = getNextObjNumberPadded();
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2020 04:27 PM
It worked like a charm