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
      • 6 yrs agoFri, November 23, 2018 at 3:01 PM UTC
      • Reported - view

      Good to know.  Thanks for the update.

      Happy Invoicing.

       

      Tim

      • Rico
      • 5 yrs agoSat, July 27, 2019 at 8:15 AM UTC
      • 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
      • 5 yrs agoSat, July 27, 2019 at 8:20 AM UTC
      • 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
      • 5 yrs agoSat, July 27, 2019 at 9:34 AM UTC
      • 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
      • 5 yrs agoTue, July 30, 2019 at 8:42 PM UTC
      • 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
      • 5 yrs agoThu, August 1, 2019 at 4:00 PM UTC
      • 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
      • 5 yrs agoMon, September 16, 2019 at 2:30 PM UTC
      • 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
      • 5 yrs agoMon, September 16, 2019 at 3:30 PM UTC
      • Reported - view
      • james_deraps
      • 5 yrs agoTue, September 17, 2019 at 3:02 AM UTC
      • Reported - view

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