Auto increment ID in cuba example

Hi community,

I am looking for a way, to auto-increment an id from a specific range like 2000 - 2100

does anybody have a sample code for it?

Thank you

1 Like

I’m thinking that you need to use the UniqueNumbersAPI

https://doc.cuba-platform.com/manual-6.9/uniqueNumbers.html

Set your start number to 2000 using setNumber(), and when you hit 2100 use the same call to set it back to 2000 again.

Haven’t tried it, but I reckon something like that should work.

1 Like