mhudd Posted February 23, 2002 Posted February 23, 2002 I'm creating a runtime FM DB that has 5 auxillary files. I'm trying to plan for a future upgrade and want to script the process. Is it tough to do?
Chuck Posted February 23, 2002 Posted February 23, 2002 Yes, but not impossible. If you plan ahead you'll make it easier on yourself. Here's the basic algorithm for upgrading: 1. Make sure all the files in the old system are showing all records 2. Import the records from the old system to the new system 3. Update the serial numbers of the new system to coincide with what they were in the old system Obviously, steps 2 and 3 are the most difficult. Step 2 is only really difficult if you add fields or change the names of fields. If you try not to do this, then you can simply create an import script that imports using matching names. But if you change the name of a field, and that field isn't a calculation field or something else that doesn't need to worry about being imported, then you'll screw up the import process or have to do it manually. Step 3 is much simpler now that FileMaker has provided a Set Next Serial Number step. After the records have been imported into the new system you want to get the largest serial number that already exists. You do this easily by showing all records, sorting by the serial number in descending order, and noting what the serial number is. This assumes that your serial numbers are number fields and not text fields. If they are text fields you've got to do some other work to find the largest one. Once you know the largest serial number, then you just set the next serial value to that number plus one. I'm sure others will have some more tips. Chuck
mhudd Posted February 25, 2002 Author Posted February 25, 2002 I'm not quite sure how to sort the serial # list and then select the hgiest serial #,,,
Vaughan Posted February 25, 2002 Posted February 25, 2002 If you sort by serial number descending, the highest serial number is on the first record.
mhudd Posted February 26, 2002 Author Posted February 26, 2002 To ensure my runtime upgrade reads and starts the users DB with the right unique_serial number I'm considering the following upgrade script. Show all Records Go to Record/Request/Page [Last} Set Next Serial Value ["unique_serial","uniques_serial + 1"]
Chuck Posted February 26, 2002 Posted February 26, 2002 I would recommend this instead: Show all Records Sort [ unique_serial, descending ] Set Next Serial Value ["unique_serial","uniques_serial + 1"] After the sort you should be on the first record of the found set. There's no need to go to the last record. Your other option is: Show all Records Sort [ unique_serial, ascending ] Go to Record/Request/Page [Last} Set Next Serial Value ["unique_serial","uniques_serial + 1"] But why do it that way when you can remove the superfluous Go to Record/Request/Page step by sorting in descending order instead? You need to sort somehow so that you can be sure that the highest value is either the first or last value. Chuck
mhudd Posted February 26, 2002 Author Posted February 26, 2002 Chuck I appreciate your perspective AND help! I'll follow your advise. Michael
Recommended Posts
This topic is 8363 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 accountSign in
Already have an account? Sign in here.
Sign In Now