Sounds like a problem with the field mapping, but without actually opening the script up and checking that in the relevant dialog, I can't say much more.
Are you by any chance using a $Path variable to find the file from which to import this data? There might be an issue there if the $path variable AND a valid (at time of script definition) additional file reference is not used to set up the import script step.
Phil, agree it may have something to do with field mapping. It is unfortunetly that in the Import Mapping Window does not show the fields from source, to make it easier to match fields.
Yes, am using a $Path variable; however, I don't understand your comment about " ... additional file reference is not used ..."
First I set the "Arrange By:" Field Names, this sorts the Target Fields, Hit Ok, Run the script and it is problematic. Then reopen the script and set the Arrange By: to Matching Fields, Run the script and it is problematic.
Guess will have try all the variations of sorting the Target fields, lucky there are only 3 fields, therefore should be 3x2x1 = 6 variations.
As per last post, have tried all variations of sorting the Target Fields. Observation:
1) If I use Matching Field in "Arrange By:", irrespective of manual Target Field sort, always get: ERROR 409, Import Order Is Invalid.
2) If I use anything else in the "Arrange By:, irrespective of manual Target Field sort, always get: Import from the same wrong table.
What else to try ???
If you just use a $Path variable as the file reference, the script fails to retain the field mapping. (Unless they fixed this in FileMaker 14).
So to set up and retain field mapping. Set up your Specify File dialog to look like this:
use the Add file button to to add the second reference to this dialog.
Now, while you set up the import records step, $PathVariableHere has no value and thus is not a valid file reference. FileMaker tries that first reference, finds that its not valid and switches to the second reference. It opens this file and displays the field names from the source so that you can align them correctly to set up the import records step.
Now, when you run the script while first setting the path variable to a valid file path, FileMaker uses the first reference--the one with the variable to access the correct file, but now your field mapping is retained and the import works as you set it up to work.
For more on $Path variables, container fields, file paths and the script steps that sue them, see: Exploring the use of a $Path Variable in Scripts
Phil, a BIG thanks, It worked, ... fascinating, ok, maybe not, but it worked without inserting the - file:FileNameHere.fmpur - in the Specify File dialog for the first 4 tables using the $Path variable only. Just the last table where it breaks down.
OK, will now use the - file:FileNameHere.fmpur - in the Specify File dialog for the other table imports just in case stuff happens.
I'm surprised you got anything to work for the first four tables. That's never worked for me...