The usual way to do this is to Import with NO auto-enter, ie., the 2nd dialog [ ] Allow auto-enter unchecked. Then there are 2 methods to update the "next serial number." The first is the easiest, so most people use it. FileMaker has both a script step and a function to do this. You'd need to do this for each table imported.
Go to Layout ( table's layout )
Show All Records // not really needed, as you just imported, but what the heck
Go to Record [ Last ]
Set Next Serial Value [ your serial ID field; SerialIncrement ( your serial ID field; 1 ) ]
SerialIncrement is a Text function. There is one caveat using the above method. Which is that there is a (very) slim possibility of incorrectly assigning existing child records to a new parent record, in the following scenario. You deleted the last parent record, just before doing this, leaving "orphaned" child records with its ID. The "next serial id" of the parent table is updated to the SAME ID as the record which was deleted. So the next new parent record would link to the (no longer orphaned, but now incorrectly linked) child records.
As I said, very unlikely, but possible. The cure is to always have "Delete related records" turned on in all parent->child relationships. Which is a good idea anyway in almost all cases.
Or use a more intensive method, which gets the serial numbers from the "old" file. That's what I do, but it's a bit more intensive to set up, and requires that you know the exact name of the old file. It uses the GetNextSerialValue (file name; field name) function to get the value from the old file.
If take it that my issues start here my import script:
Go to Layout ["Main_Page" (Main_Page)]
Go To Record [Last]
Set Next Serial Value [Max ( GetField ( Main_Page::RecipientID ) + 1 ; GetNextSerialValue ( Get (FileName) ; Main_Page::RecipientID ) )]
No, not really. If you were going to use the simple "last record" method, and the IDs were in incrementing order (they should be, if you've done them right, and the file is Unsorted, which is creation order), it would just be:
Set Next Serial Value [ Main_Page::RecipientID; SerialIncrement ( Main_Page::RecipientID; 1) ]
You don't want Max or GetField, you don't need "+1", because the SerialIncrement function adds 1, if that is what you specify for the increment. The above is the way most developers do it. Be sure to check the "next serial" number after testing. It is a critical part of your database.
I don't consider Get (RecordID) a safe option for using as a primary key. The imported records can easily be assigned new and different values during the import and there is no simple way to prevent this. (This is not an auto-enter option you can disable during import.)
An auto-entered serial number with the scripted update of the next serial value as Fenton describes is really the only safe option in FileMaker systems.
I have removed the Get(RecordID) for the primary key and Set Next Serial Value [ Main_Page::RecipientID; SerialIncrement ( Main_Page::RecipientID; 1) ] for the import.
All works fine. Thanks.