10 Replies Latest reply on Nov 5, 2014 12:53 PM by philmodjunk

    Import not working (sometimes)

    FilmUser

      Title

      Import not working (sometimes)

      Post

      FMP 12  - FMServer 12 - Windows 7

      Hello – I administer a database containing a number of tables and relationships between them.

      Think of this as a data base of products. One table (Products) contains code numbers and descriptions, one table (MKT numbers) stores special marketing numbers, assigned to only certain products in the Products table.

      The user creates the products, then performs a find for the products requiring a MKT number. Then the user navigates to the MKT table by scripted button which opens a new window in the MKT table layout, positioned on the display to see both windows.  (Users are encouraged to have only one Product window open, containing the found set of products before going to the MKT layout.) A button on the MKT layout imports from the Products table the found set of codes. These MKT numbers are then assigned by another user from an offline system.

      First script step is a custom message to ensure the correct found set, if “no” exit script, etc.

      Second step is the import, scripted to navigate to the server hosting the data base, then to the Products table, then importing the codes, and two other fields from Products. These fields are in both tables, imported from Products to MKT, if that matters.

      The script then sets two fields in the MKT layout, one Current date and one Acct name, as a means of tracking who uses the script and who imports manually, sometimes even one code at a time.

       

      Occasionally, the script will import many, many records, even though the found set is correct. This happened to me last week, so I closed all windows except one (in Products), found 10 items, opened the MKT table layout, ran the import script, and knew by the coffee cup that I was importing at least 1000 records. Also, when this happened, only the first record had the data set into the fields described above in the last steps of the script.

      I started over, ran the script again, and the same thing happened.

      This doesn’t happen very often, but I must have something incomplete in the script.

      Any suggestions?

        • 1. Re: Import not working (sometimes)
          FilmUser

          Maybe a clue:

          I just tried something else, just running the import from the Import icon on the tool bar, with 3 records in a found set in Products.

          Imported 1390 records. Products has a field classifying products by Divisions (as in company divisions). It is importing all of the codes for the division of the found group, 1390 in this last case.

          A subsequent test shows that the same 1390 records are being imported every time, manual import, regardless of the found set. What can be happening?

          • 2. Re: Import not working (sometimes)
            philmodjunk

            Each window has its own set of "found sets".

            Try doing the entire operation, finding the records to import, then importing the records all from one window. (This suggestion assumes that you have both tables in the same file.) It's possible that the window where you do the import has a different found set than the window where you performed the find.

            Also, it can make a difference which table occurrence for a given table is selected as the source table for your import as each table occurrence within a given window, has its own found set.

            • 3. Re: Import not working (sometimes)
              FilmUser

              The two tables are in the same data base.

              I tried what I think was your suggestion - I'm in the Products table, with a found set. In this table I manually click the (tool bar) icon for importing. I make the left side of the import window be the same table as I am in (the "donor" table), but all of the other tables are disabled on the right (destination) side. The MKT table shows, but is disabled.

              I didn't mention this before, but this script has been working for almost a year, so I'm puzzled about this.

              Also, to your comments: There is only one relationship between Products and MKT, using the original TO for products (which has other TO's for other reasons) and the single (only) TO for the MKT table in the data base.

              • 4. Re: Import not working (sometimes)
                philmodjunk

                If you are manually importing records, you cannot use the drop down list of table (occurrences) to select a target table for the import. (This is strange, but how it works, the drop down is only used in manual imports to specify "new table" as the target table.)

                The layout that you have currently selected determines what table is currently specified as your target table. So if you want to import into the MKT table, you'd first pull up a layout based on the MKT table (occurrence).

                • 5. Re: Import not working (sometimes)
                  FilmUser

                  OK, makes sense, but we're back to the original post. The import is made from the MKT table (intended recipient, or target), with only one other window open, the Products, with the correct found set. But the import still returns a large number of items.

                  • 6. Re: Import not working (sometimes)
                    philmodjunk

                    with only one other window open...

                    and do you recall that I suggested not having any other windows open?

                    That you might have a different found set in place for the source table because of that fact?

                    Have you tried making that change?

                    This need not be the final solution, but if doing it all in one window gets things working, it will tell me where you have you look in order to get this working with multiple windows open.

                    • 7. Re: Import not working (sometimes)
                      FilmUser

                      Phil - I'm not sure what you mean by one window, but let me be more explicit:

                      I'm in Windows 7, so, unlike the Mac, all open windows are inside one big App window.

                      When doing the import, a window is open for MKT, from which the import script is executed. There is also one Products window open, which contains the found set to be imported. No additional windows are open.

                      If I close the Products window before importing, what will determine the found set? Maybe I'm missing something here.

                      • 8. Re: Import not working (sometimes)
                        philmodjunk

                        Do it all in one window.

                        Navigate to the products layout. perform a find for the records that you want imported. without opening another window, change over to the MKT layout. Import your records.

                        Now you have done this all in one window.

                        These steps will only be possible if MKT and products are table (0ccurrences) in the same file.

                        The multiple windows inside the App window in a windows system and the multiple windows with no enclosing app window as you'd find on a Mac system behave the same when it comes to found sets.

                        • 9. Re: Import not working (sometimes)
                          FilmUser

                          Worked like a charm, thanks as always.

                          Puzzling, though, how this wasn't an issue for the first year of use.

                          • 10. Re: Import not working (sometimes)
                            philmodjunk

                            Much depends on how/when you open that second window...