Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

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() ;