Auto Generate Serial Number On FileMaker Commit

From Dwayne Wright PMP, PMI-ACP, CSM
Certified FileMaker Developer

TWITTER: dwaynewright
YOUTUBE: FileMakerThoughts

I got another problem is when i used auto serial number for my ID and then when I use a script to create new record ok or cancel in the dialog then if i click ok and so far is so good as the ID will go in sequence and unique but problem exist when i click cancel without keying anything on that record and is record ID cancel and deleted in script for example is number 8 and next new record created in OK button will not get back the iD 8 instead it goes to 9 and next time you sort the ID field you will find some missing ID here and there. My question is, it is possible that we can use back the ID number we deleted off and come back to a new record ?

For the other readers, we want to set the context that you must have turned off the ability for FileMaker to automatically save new records. This setting can be found in the layout setup dialog box, therefore layout specific. The default setting for this is to "Save record changes automatically".

When you setup a field to auto generate a record number data sequence, the default action is to pick a new number when the record is first created. So the action you mentioned is natural and the side effect can be gaps in your record id sequence. If you look closely at the auto enter setup area, you may notice a couple radio button choices to generate on creation or on commit. Moving this setting to the on commit side should give you the behavior you are looking to incorporate into your solution.

© 2014 - Dwayne Wright -

The material on this document is offered AS IS. There is NO REPRESENTATION OR WARRANTY, expressed or implied, nor does any other contributor to this document. WARRANTIES OF MERCHANT ABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY DISCLAIMED. Consequential and incidental damages are expressly excluded. FileMaker Pro is the registered trademark of FileMaker Inc.