7 Replies Latest reply on Jun 18, 2015 12:13 PM by philmodjunk

    Import Records Error 409, Import Order Is Invalid

    rouelf_1

      Title

      Import Records Error 409, Import Order Is Invalid

      Post

      Performed a “Save a Copy As” with a name: Update.fmpur, then transfer it to all devices, then use a script to cycle thru five tables to Import Records. Four Tables with lots fields and records perform the imports correctly. Issue: One table, the simplest, with one record and 3 text fields, results in ERROR 409, Import Order Is Invalid.

       

      Have tried all the variations in defining the script step. Have tried deleting the table and layout, recreating the table and layout, correcting the all scripts. Issue persists. Is there a suggestion for something else to try ?

       

      Just thought of something to try !

        • 1. Re: Import Records Error 409, Import Order Is Invalid
          philmodjunk

          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.

          • 2. Re: Import Records Error 409, Import Order Is Invalid
            rouelf_1

            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.

            • 3. Re: Import Records Error 409, Import Order Is Invalid
              rouelf_1

              Guess will have try all the variations of sorting the Target fields, lucky there are only 3 fields, therefore should be 3x2x1 = 6 variations.

              • 4. Re: Import Records Error 409, Import Order Is Invalid
                rouelf_1

                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 ???

                • 5. Re: Import Records Error 409, Import Order Is Invalid
                  philmodjunk

                  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:

                  $PathVariableHere
                  FileNameHere.fmpur

                  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

                  Caulkins Consulting, Home of Adventures In FileMaking

                  • 6. Re: Import Records Error 409, Import Order Is Invalid
                    rouelf_1

                    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.

                    • 7. Re: Import Records Error 409, Import Order Is Invalid
                      philmodjunk

                      I'm surprised you got anything to work for the first four tables. That's never worked for me...