Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

I'm moving up from FMP6 to FMP8.5, and am rewriting a lot of old code to take advantage of new functions.

If I have a stack of records with ID numbers 1-6,8,9,10, and I want to create a new record with an unused ID number, it is trivial to just keep an incremental ID and add one with every new record. However, I want it to see which numbers are unused, so if I create a new record it assigns ID number 7 in this case.

Any suggestions or links? (Yes, I have been searching though these fora but haven't found an answer yet.)

Thanks for your time

Posted

I'd suggest you leave the unused numbers unused, and just keep incrementing from the highest used number up. If, for some reason, it is important to have consecutive numbering, you could renumber your old records (this requires a carefully thought out process, esp. if the numbers are used for relationships).

Trying to assign unused numbers to newly created records is a recipe for disaster, IMHO.

Posted

OK, advice taken.

I have a method of doing it in FMP6, but it is remarkably clunky. Hopefully somebody will have an idea. I'd prefer not to give up on the idea, but the method I have now is just too much of a kludge.

Posted (edited)

...hmm. OK, same problem, different aspect.

Assuming I want to create a new record with a new highest number, but the records are not in sequential order. For example, the last record in the database could be No. 6, but there could be a No. 8 in the same database.

Is there a trivial way to determine what the highest value for a field is within a given database?

Edited by Guest
Posted

I strongly suggest you use Filemaker's built-in serial number generator. I don't know of any other reliable method to generate unique record identifiers.

See also:

http://fmforums.com/forum/showpost.php?post/258882/

http://fmforums.com/forum/showpost.php?post/236719/

Posted

Thanks to yuo all for your input. Let me go back and take a look at what is needed to get the job done, and see if auto-generate can do it.

I guess this thread's closed now.

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