0

Need a field formula that inserts a unique and sequential number?

What is the formula to insert or create a unique and sequential number for a record? I need that number to never change by itself, in other words, a customer's account number never changes and is unique. The built-in Id field does not do what I need since Ninox changes those numbers when synced across devices.

34 replies

null
    • timtaylorrrfan
    • 5 yrs ago
    • Reported - view

    Good to know.  Thanks for the update.

    Happy Invoicing.

     

    Tim

    • Rico
    • 4 yrs ago
    • Reported - view

    Related to the requests for an automatically incremented number, these people seem to make it simple:

    https://support.knack.com/hc/en-us/articles/230231768-Start-an-Auto-Increment-Field-from-Any-Number

    • Rico
    • 4 yrs ago
    • Reported - view

    By the way, my post wasn't meant to plug that product, just to show how a simple implementation of a sequential number.

    • Ninox partner
    • RoSoft_Steven.1
    • 4 yrs ago
    • Reported - view

    Problem is when you make use of the record ID is when you delete a record the numbers wouldn't be in a sequence annymore. So 2019+recordID is not a good idea.

    • Thunderfix
    • Paul_Kidd_thunderfixco
    • 4 yrs ago
    • Reported - view

    Is it possible to make TFH001 sequential then TFH002, I understand the sequential scriptt but I ideally need it with the suffix TFH

    • Jorg
    • 4 yrs ago
    • Reported - view

    Hi Paul, 

    Please download the template "Invoices" via the button "New database". There you will find the formula in the table properties of the invoice table in the option "Trigger after create". 

    In that formula you can exchange the suffix.

    Kind regards, Jörg

    • Music
    • Mats
    • 4 yrs ago
    • Reported - view

    I also have som problems with the Invoice numbering. I want number my invoices without the year-prefix (e.g. 120, 121, 122 etc...) and start on a specified number. 

    When inserting the code mintioned here earlier 

    let before := max((Table1).Invoice No.);
    Invoice No. := before + 1 

    To make sure there aren'r anything I've messed up I tried this with a new epty Invoice template.

    When using the code above it results in 1, 11, 111, 1111, 11111 etc. 

    How do I correct that and how I define a start value?

    • Ninox partner
    • RoSoft_Steven.1
    • 4 yrs ago
    • Reported - view
    • james_deraps
    • 4 yrs ago
    • Reported - view

    Mats before must be a number     let before := number (max((Table1).Invoice No.));
    Invoice No. := before + 1 

Content aside

  • 4 yrs agoLast active
  • 34Replies
  • 14119Views