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

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

Recommended Posts

Posted

When I add new record, middle of data and I change my mind and cancel/delete the new record. After that new record start from new number and skip the cancel record number. Please review attached three pages. Every page is one proble alltogether three diffrent problems and problem I'm talking about is second page. If you can help me with all the problems I really appreciate. Need some desprate helppp!!

needhelp.pdf

Posted

Hi COOLROGER,

When the user cancels, you need to set the your next serial number value via the Set Next Serial Number script step. In other words, you need to create a script that deletes the record and then (re)sets the serial number for your record ID.

The field to be acted upon for this script step should be your record ID.

The calculation for the script step should be:

Max(YourRecordIDField) + 1

Replace "YourRecordIDField" with the actual name of your record ID field.

For the question about field formatting (phone numbers and social security numbers), search the forum for "field masking" or "field formatting". There are a number of posts that will show you how do accomplish this.

Hope this helps!

Cobra

Posted

FMP 7 has the ability to only increment the serial number when the records is committed.

Alternatively, let the user enter the new data in global fields and only create the new record when they decide to "save" the new record.

Posted

Thanks for your help guys I'm half ways with your help.

This is good

Max(YourRecordIDField) + 1

but I need a script that create a script that deletes the record and then (re)sets the serial number for your record ID.

Thanks again

Posted

This kind of re-setting serial numbers thing can barf itself in a multi-user environment. Imagine if two or more users are doing this simultaneously... Safest bet is entry into global fields, then enter them into a new record only when they decide to save the data.

Let FMP manage the unique ID numbers itself. The consequences of having duplicate IDs far outweighs having a few numbers missing.

Posted

Hi All,

COOLROGER , I think everyone else is right.

It is best to leave gaps in your serial numbers. The culprit in my solution is Max(YourRecordID). While FileMaker is calculating Max(YourRecordID), other users may be creating new records, which would not be taken into account.

Also, if someone deletes a record after another user has created a new record, Max(YourRecordID) will never be able to account for the gaps in serial numbers.

As Vaughan said, just let FMP manage the Unique serial number values itself.

Sorry about the misleading post.

Cobra

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