Jump to content

serial number


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

Recommended Posts

with out using auto serial, I can create a calc that will get the max of the field and add 1 when creating a new record, which is great untill two users create a record at the exact same time and then I have a duplicate id. Can you think of any way to avoid the dup (no using the unique validation) but through a calc???

I am trying to allow the users the use of the regular menus items without having to use a button that I would create.

Link to comment
Share on other sites

From what I know, the only really safe way to get an incrementing number is to produce it, via script, in a 1-record table, with the record locked while the script is running. In 7 you would use an explicit Open Record to lock it, then Commit Record to release it.

This would be inside a Loop, with ErrorCapture[On]. It would run for a set number of tries, looking for error=0, then give up if still locked, with a dialog. This is all the same as FileMaker 6, except for the explicit Open Record (in 6 Go To Field would lock it, but no longer).

Also, the max() function gets slower and slower as you accumulate records. Logically a Last() function should produce the same thing a lot faster, if the numbers are incremental, which they are supposed to be.

Or use ONLY scripted deletion, and adjust the "next" number in the 1-record table, so it is always correct.

I don't think there's any foolproof way to get these incrementing numbers via the "regular menus", ie. New Record. As you say, there's a possibility that 2 users will create a new record at exactly the same time.

Link to comment
Share on other sites

This topic is 6683 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.