Service Desk Practitioners Forum
cancel

Automatic Increment of IDs

Highlighted
Fepelof_1
Respected Contributor.

Automatic Increment of IDs

Hi there,

at the problem form, we intend to create an alternate ID, that will be on when a condition is met. I picked one Number field and put in the form.
When a new problem is registered, this new ID must be incremeted by 1 unit from the last one. Is it possible to make a rule to do that ?

thanks
Fep
3 REPLIES
George M. Meneg
Acclaimed Contributor.

Re: Automatic Increment of IDs

The easier way to do this is to use update to external application. All that external application has to do is

select count (*) from itsm_problems

add 1 to the number above and that's your ID :)
menes fhtagn
Robert S. Falko
Acclaimed Contributor.

Re: Automatic Increment of IDs

Fep,

George's solution will work in a perfect world. You may wish, instead to select the LAST row in the table, ordered by your new field, and then increment that value. If you do NOT need to see this value as soon as you create the item, use a DB rule to do this. If you need to see the value when you create the problem, but not necessarily from the beginning, consider a DB rule, but you would need to do a save then a refresh to see the value. Finally, if you need to see the value from the very beginning, use a UI rule. But with a UI rule you have the problem of creating two problems concurrently, and then deciding NOT to save the first, which would leave a lacuna in the series.

-Josh
Fepelof_1
Respected Contributor.

Re: Automatic Increment of IDs

hi there,

actually I don´t need to see it online, so a DB Rule would be enough, I just don´t know how to implement it.

thanks
Fep