Is there a way to rest the auto number function?
I built and tested a form and now would like it to start again at 1.
I tried deleting the rows from the autonumber table, but that didn't help.
Welcome to the nuBuilder forums!
Please register and login to view forums and other content only available to registered users.
Please register and login to view forums and other content only available to registered users.
Reset Auto Number
-
- Posts: 54
- Joined: Fri Oct 23, 2015 12:34 am
Re: Reset Auto Number
Thank you for reading.
I reset this by running a query in HeidiSQL
alter table auto_xxx_xxxx AUTO_INCREMENT=1
My other question has a related thread around here somewhere.
I reset this by running a query in HeidiSQL
alter table auto_xxx_xxxx AUTO_INCREMENT=1
My other question has a related thread around here somewhere.
-
- Posts: 54
- Joined: Fri Oct 23, 2015 12:34 am
Re: Reset Auto Number
I thought I could use the live demo to get a code to pick a new auto number only when saving a new record, but it looks like the invoice in the demo pulls a new number when creating a new invoice.
This behavior allows you to create an invoice, not save, go back, and create another one, skipping an incremented number.
I am hoping to only pull a new number when the record is saved.
I am trying to do it in custom code / before save.
This behavior allows you to create an invoice, not save, go back, and create another one, skipping an incremented number.
I am hoping to only pull a new number when the record is saved.
I am trying to do it in custom code / before save.
-
- Site Admin
- Posts: 2781
- Joined: Mon Jun 15, 2009 2:23 am
- nuBuilder Version: 4.5
- Been thanked: 1 time
Re: Reset Auto Number
mobilemcclintic,
Try doing it After Save because Before Save won't have a new Primary Key assigned (#RECORD_ID#)
Steven
Try doing it After Save because Before Save won't have a new Primary Key assigned (#RECORD_ID#)
Steven