Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Script for serial number

Featured Replies

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

The Auto-Enter Serial Number will increment to the next number. You can have alpha characters, such as 'quote1' and the Auto-Enter will create 'quote2' for the next record.

Hope this helps.

Garry

  • Author

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.

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.

  • Author

Thank You Vaughan.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.