August 22, 200421 yr 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
August 22, 200421 yr 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
August 22, 200421 yr but i'd hesitate to do this in a multi-user setting as you might get duplicate numbers. better to just have the gaps.
August 22, 200421 yr 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.
August 24, 200421 yr Author 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
August 24, 200421 yr 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.
August 25, 200421 yr 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
Create an account or sign in to comment