New field with auto-increment

ericeger
Tera Guru

Hi everyone,

I created a field "Reference event" that I want to act similar to how Incident works with auto-increment with the prefix INC.   I made a new prefix in Number Maintenance and added a business rule with a condition "current.event_reference.nil() and a script:

function onBefore(current, previous) {

    current.event_reference = getNextObjNumberPadded();

            gs.addInfoMessage("Created Incident " + current.event_reference );

   

}

The column in my table has the default value Next Obj Number Padded.   When I go to my form, it is not showing a value at all.   Anything else I should consider? Any help would be great, thanks!

5 REPLIES 5

rahul_garg
Kilo Expert

Do it like this in the default value. Dont use it as dynamic



javascript: global.getNextObjNumberPadded() ;