7 Replies Latest reply on Sep 9, 2016 7:56 AM by philmodjunk

    What can cause scripted import order to change?

    AdamSnyder_1

      I have an offline filemaker go database that syncs back to a database on filemaker server.  For some reason, the import order changed on two of the import script steps.  Several fields were aligned wrong.  Both import steps were set to "update matching records" and "arrange by last order".  I really wish filemaker would let you keep  "arrange by matching names" when "update matching records" was selected, but it always changes to last order.

       

      There were quite a few fields added and deleted in both files, but I thought new fields were always added at the end of import steps, and if a field is deleted it would show up as "field missing" next time you open the import step.

       

      What are the scenarios that can cause the import field matching to change on it's own?

        • 1. Re: What can cause scripted import order to change?
          David Moyer

          Hi,

          I think the deleting of fields will cause that.  I too wish that the import tool was more robust.

          • 2. Re: What can cause scripted import order to change?
            coherentkris

            Adding and deleting fields will cause this.

            Always check import/export order after changing a table involved in these processes.

            Import and export is a functionality that is ripe with opportunities for improvement.

            See the product ideas section.

            1 of 1 people found this helpful
            • 3. Re: What can cause scripted import order to change?
              Vincent_L

              If set to custom order (which I always do), the order shouldn't change. The fact that deleting a field, changed the matching WAS a bug from 7 till 12v4. 12 was supposed to fix it, but it failed in first releases, and also, for the fix to work, you have to re-open, change a bit the matching, close, re-open, re-set it to normal. This will force the new system to lock the order.

              Unfortunately, file conversion doesn't do this itself.

              When you look at the xml o te old and new method, you'll see the fields ids in the new one, while before it was just the order.

               

              The above data dates from the 12v4 days, afterwards I stopped monitoring this.

              1 of 1 people found this helpful
              • 4. Re: What can cause scripted import order to change?
                AdamSnyder_1

                I tried setting it to "custom order", but it always automatically changes itself back to "last order" every time I open the import step.  How can I get "custom order" to stick as the setting?

                 

                There are a ton of extra fields I want to delete from our live database, but I can't push out a new offline mobile version every time I delete a field...  There must be a way to delete fields from the schema without messing up import orders.

                • 5. Re: What can cause scripted import order to change?
                  philmodjunk

                  How do you specify which file to import? You need to select an actual, currently available file for the import first, then set up the import order. This will then enable the specified import options to "stick" and you no longer need any dialogs to open during the import.

                   

                  If the file's name and/or location will change each time, there are tricks where you can specify both a $Path variable and a physical file while setting up the import step and then you move or rename the file after you've saved your script that will work to "keep" the specified import order as part of the script.

                  • 6. Re: What can cause scripted import order to change?
                    AdamSnyder_1

                    There are 2 file paths in the import step.  The first one is a variable that is just defined as get(FileName).  This is the source that is used when it's offline on mobile.

                     

                    The second source is a relative file path "file:[solution_filename_here]".  I added this so I can line up the fields while i'm developing it on our server.

                     

                    The mobile database has an external reference to the live database, so it's using itself as the source, but it's importing into external tables on the server.

                    • 7. Re: What can cause scripted import order to change?
                      philmodjunk

                      That is exactly the method that I am describing.

                       

                      As long as the file specified in the second line exists at the location specified at the time you specify the import options such as the field mapping, those options should persist after you save the changes to your script.