Jump to content

Script for serial number


This topic is 8208 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I'd like to write a script that generates an alpha numeric serial number that is only one higher than the last record. When I use the auto enter function from The "define fields" dialog box, new records show the next absolute serial number (from some library I suppose), not one higher than the last record.

Help, and thanks

Link to comment
Share on other sites

Garry,

Thanks, but my problem is that I am trying to write a script in my main file that will go to a number generator file, create a new record-serial number, and return to the main file and paste it into a serial number field, IF it is empty. ELSE, execute a sub-script that deletes the number generator file record containing the new serial number. That works fine, but when I execute the script that goes back to the number generator, the next new record gets a serial number that ignores the fact that I deleted the previous record, and gives what should have been the next value, had I not deleted the record.

Link to comment
Share on other sites

In FMP 5.5 there is a script step that can reset the "next value" for the serial number. This'll do what you want.

On the other hand, why not reverse the process: only run the script if the serial number field is empty. That saves creating/deleting the record in the first place, and the solution will work with any version.

Link to comment
Share on other sites

This topic is 8208 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.