0

Incremental numbering continuing from a set number

I need to start incrementing unique numbers that carry on from a set of numbers I have already been using.

So for example the last number I will use on my old system will be 02399, so I will need my numbering in Ninox to start from 02400.

Is there a way to do this as it is quite important as these are job and invoice numbers so need to keep continuity.

Many thanks in advance.

3 replies

null
    • Mconneen
    • 4 yrs ago
    • Reported - view

    Sure... let us assume the table name is Invoice ... and the filed name is 'Invoice Number'..   then in your Invoice trigger on create .. put something like 

    let t:= this;

    t.'Invoice Number':=max((select Invoice.'Invoice Number'))+1

    • davidw
    • 4 yrs ago
    • Reported - view

    @Mconneen,

    Thanks for the reply and apologies for the late reply.

    Can you tell me, am I supposed to replace part of the above code with the preceding number I want to start with, or do I insert it somewhere within this code?

    As I presume Ninox needs to know with which number it needs to add +1 to?

    Apologies if I am being a bit thick.

    Many Thanks.

    • manuelorduno
    • 3 yrs ago
    • Reported - view

    Just what i was looking for.  Thank you!

Content aside

  • 3 yrs agoLast active
  • 3Replies
  • 1347Views