Incrementing a Number

Invoke
Kilo Contributor

Hello,

I am wanting to increment a field by one in a UI action that I am using. I think I need to write this in my UI action something similar to:

current.u_number = getNextObjNumber();

However, I don't want the next object number as this will just give me the next incident number. When my button is pressed (UI Action) I just want the field to be updated with 1 and then next time with 2, the next time with 3 and so on....

Think its just a piece of javascript that i'm missing.

Can anyone help?

Thanks

5 REPLIES 5

This should do the trick.

current.u_number++;
current.update();
action.setRedirectURL(current);