Jump 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.

get next serial number

Featured Replies

hi all !

when i update old file with new one, if i import the old data to the clone of the updated file, people said i have to update the auto enter serial number.

how is this a problem and what should i do to solve this problem ?

and i heard i can solve this problem with fmp 5.5's get next serial number feature. if it is , can somebody show me the way ?

so basically i like to know why this become a problem and how i can solve this problem on fmp5.0 and fmp 5.5.

Thanks,

kyle

Suppose the users' working file has 20,000 records in it and hence the last serial number is 20,000. The copy that you have been modifying has only 10,000 records in it. When you deploy the new version, you delete the 10,000 records from your modified copy and import the 20,000 records from the users' file into it. But, the next serial number will be 10,001 unless you reset it. If you don't, and a user creates a new record, you will start getting duplicate serial numbers.

To avoid this, create a script that finds the maximum value of the serial number field, and then uses the Set Serial Number step to set the next serial number to that value plus 1.

Would this be a step you would recommend always putting in the startup script?

  • Author

thanks, bob ! i got it. i just like to confirm that that is the only problem. is it ?

jason, i think it is not necessary to put this script step on a start up script. i would put it in a update master script which contains the import script.

regards,

kyle

Hi Jason,

As Kyle says, its value in a start-up script would be limited - though if you were expecting to update the file and forget to run a set-serial script, then it might be a failsafe/damage-control mechanism of sorts, I guess.

However there is sometimes value in including the procedure in a 'Delete record' script, so that if users erroneously create a new record, then delete it, non-contiguity of the serial sequence does not result.

Similarly, files which have a closing script which locates and purges any empty records (a feature sometimes found in files designed for use by novice users - eg in junior schools etc), can benefit from a set-serial sequence on the tail end of their exit script.

Thanks Ray!

That's some good advice.

Create an account or sign in to comment

Important Information

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

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.