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.

Auto-enter that gets the highest number+1

Featured Replies

Is there a calculation that would allow me to get the highest value in a field and then ad 1.

I can't think of a function that I could use to get the highest value in the dataset.

Thanks

Kevin

Max ( ) with a self join? Hopefully, you're not trying to generate a serial ID for use as a key with this function.

get the highest value in the dataset.

It depends on how you define "the dataset" - it could mean the found set, or all records in the table.

Either way, you can only get the highest value in the dataset AT THAT MOMENT - so if two users create a new record each at approximately the same time, you can very well get a duplicate value.

  • Author

Max ( ) with a self join? Hopefully, you're not trying to generate a serial ID for use as a key with this function.

It is going to act as an ID, but not the only one. There is an absolute ID that is a standard serial number, but what I need this to do is be a bid number but the users sometimes start a new record and then delete it so the bid numbers have holes and they are really tired of those holes. I am trying to recreate what other Databases do with serial numbers by only incrementing on the highest number.

  • Author

It depends on how you define "the dataset" - it could mean the found set, or all records in the table.

Either way, you can only get the highest value in the dataset AT THAT MOMENT - so if two users create a new record each at approximately the same time, you can very well get a duplicate value.

I wouldn't want it to be influenced by the found set, but that just might not be possible. There is really only one user at a time so duplicate values at this stage are not a problem but it is good to always keep that in mind.

Have you considered issuing a serial number on commit only, and preventing users committing a new record until they are sure?

  • Author

I had thought of that a few years ago, and something didn't work out, but now I can't for the life of me remember why. I should look into that again.

Thanks

Kevin

  • 5 months later...
  • Newbies

Not sure if this is the solution you want; I figure a simple way -

If...

Sort Record ( # ) Ascending

Go to Record LAST

Set Var $New #; # + 1

done

Edited by Guest

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.