2 Replies Latest reply on Nov 30, 2009 1:12 PM by mukelly

    Resetting Auto Generated Serial Id Numbers

    mukelly

      Title

      Resetting Auto Generated Serial Id Numbers

      Your post

      I am using Filemaker 8.5 on a Mac OSX version 10.5.8.  I am I guess a novice in terms of creating scripts and such but I learn quickly.  

       

      I have a database of artwork that automatically assigns an id number with eachentry. I have gone back and deleted some entries and this deletes theid numbers as well.

       

      I do not know how to reset the serial id function so that the numbers are consistent. For example, I do not want the auto assigned id numbers to jump from 141to 160 just because I no longer needed the records in between.  

       

      Is therea way to reset the automatic generation of serial id number so that itdoes not skip numbers when an entry is deleted?  So if I delete entry 135, 136 will become 135.  Is this possible, I can't figure it out.  

       

      Thank you in advance for your help! 

        • 1. Re: Resetting Auto Generated Serial Id Numbers
          philmodjunk
            

          You can do this, but you need to answer some questions first.

           

          You can reset serial numbers in auto-entry and update the values in existing records using Replace Field Contents in the Records menu.

          1. Make a back up copy of your file.
          2. Select a layout based on the table that contains your serial number filed and that displays the field and permits you to modify it in browse mode. (You may have to turn off an option in field options first.)
          3. Choose Show all records.
          4. Choose Replace Field Contents
          5. Select the serial number options and click the "update serial number in entry options".
          6. Click replace and you're done

          But first, think of these issues:

           

          Serial number fields are typically used as key fields linking two or more tables. If you do the above, you'll disconnect the records from any such related records and then reconnect them to completely different related records, with catastrophic consequences for your data. If it's used as a relational key, you'll need to update the key field in related tables in exactly the same way as you have with this field. One mistake here and you've got chaos.

           

          What do you gain here by eliminating the gaps in your serial numbers? I know you've said "I do not want the auto assigned id numbers to jump from 141to 160 just because I no longer needed the records in between. " but that doesn't say why you need this. There may be a better way.

          • 2. Re: Resetting Auto Generated Serial Id Numbers
            mukelly
              

            Hi,

             

            Thanks for getting back to me.  I actually just want to reset the numbers just this one time.  I weeded out some duplicates and artwork we no longer have and deleted those records so now that I have all the entries that I need I want to redo the numbers so they are consistent, then I am going to physically label the artwork.  I won't be changing it after that.  If I need to remove an entry later on I can deal with no longer having a number 240, but it doesn't make sense for me to start out with missing numbers. 

             

            I am going to give this a try. Thanks!