1 2 Previous Next 27 Replies Latest reply on Jul 6, 2014 4:25 PM by madoverlord

    Import does not seem to go to the layout that I want to use

    RoelfW

      I am scripting a "import from previous version of FM" process.

      Simple enough origina lsolution

      4 tables

      27 layouts

      nothing complicated

      I put an import button into the opening layout.

      I create a master script for this input button

      It works it way through a separate import script for each table

      I anticipate that the user might have entered stuff into a table before doing the import as follows

       

      The structure of each import script is as follows

       

      I go to the layout I need

      I show all records

      I count the number of records in the table

      I run the import record script step (no dialogue)

      I show all records again

      I count the number of records in the table after the import

      I compute the difference

      I put up a custom dialouge indicating how many records have been imported

       

      And it just does not work

      when I turn off perform with dialogue in the import script step

      it shows that is is importing into one of the other tables, not the one assoicated wit the layout

      I can't find any guidance in filemaker help other than I have to import one table at a time in the context of a layout associated with it

      That is what I am trying to do

       

      What is going on

       

      I have been searching the forum for two days and trying to work around this

      or gain insight into what I am doing wrong

      but I just can't seem to find an answer

       

      It is probably obvious

      but I can's see it

       

      Help please

       

      Roelf

        • 1. Re: Import does not seem to go to the layout that I want to use
          richardsrussell

          Here are 2 straws to clutch at: After going to an appropriate layout, try the script steps "Enter Browse Mode" and "Commit RecordsRequests".

           

          Aside from that wild stab-in-the-dark guess, I'm going to suggest that you get someone with a copy of FileMaker Pro Advanced to test this for you with Script Debugger and Data Viewer turned on.

          • 2. Re: Import does not seem to go to the layout that I want to use
            comment

            RoelfW wrote:

             

            it shows that is is importing into one of the other tables, not the one assoicated wit the layout

             

             

            The Import Records[]  script step can include stored settings - including the target table. In such case it doesn't matter which layout you happen to be on.

            • 3. Re: Import does not seem to go to the layout that I want to use
              richardsrussell

              Illustrating Michael's point:

               

              Import Field Mapping.jpg

              • 4. Re: Import does not seem to go to the layout that I want to use
                RoelfW

                Thanks Michael and Richard

                 

                That tells me why FM is acting in this way (stored settings)

                but I am still blind on how to tell it to move from the stored settings to the table that I want to import into

                 

                I have Advanced and have followed the script view step by step (including data viewer)

                but that (at least to my eyes) did not give me any more insight.

                 

                Roelf

                • 5. Re: Import does not seem to go to the layout that I want to use
                  RoelfW

                  Wait

                  I think I might have found it

                  I have to use the specific import option in the script step to select the table again

                  Simply assuming that it will pick up the context set by go to layout may not be enough

                  Will try that and see what happens

                   

                  Roelf

                  • 6. Re: Import does not seem to go to the layout that I want to use
                    RoelfW

                    I also just figured out that I better not select the auto entry option on the popup screen if I want to preserve my key serial fields and the relationships associated with these keys

                     

                    Roelf

                    • 7. Re: Import does not seem to go to the layout that I want to use
                      RoelfW

                      Thanks

                       

                      Last comment to FM folks

                      there really needs to be a better explanation of this in the help files.

                      If there is one, sorry but I have been able to find it.

                      If not, saying "one table at a time" is not as helpful as it might be.

                       

                      Cheers

                       

                      Roelf

                      • 8. Re: Import does not seem to go to the layout that I want to use
                        RoelfW

                        No it doesn't

                         

                        I now have control of the "target field" but cannot figure how to line the proper source table up with it.

                        It still defaults to an inappropriate source table

                        and the FM documentation about this script step simply "sucks - incomplete and confusing "

                        it is so unclear

                        Any ideas on where I can find out how to set the "source table"

                        so that each of my tables actually lines up

                        source to target

                         

                        Help please

                         

                        Roelf

                        • 9. Re: Import does not seem to go to the layout that I want to use
                          karendweaver

                          Roelf

                           

                          By chance, are you using the same script step for each import?  You cannot do this.  Each table must have it's own import script step. 

                           

                          It might help you to step through the import process WITHOUT using a script - that is go to each table and choose import records from the file menu.  After each successful import, create a new script for that table and save the settings - they should default to the last import you did.  Then you will have 4 import scripts - one for each table.  Then you can write a script for the button that calls each import script one by one.  That might make it clearer where you are going wrong.

                           

                          Some other suggestions:  You should post a screen shot of your script steps.  In addition, we need more details about what you are trying to do in order to help you.

                           

                          For example, what do you mean by an "earlier version of FM", exactly?  You cannot import records from a version with a different file extension.  So if you want to import .fp7 files from FM9 to FM 11, you are fine, because they both use .fp7 as the file extension.  But if  you are trying to import from .fp5 to .fp7 or from .fp7 to .fmp12 - this is not possible.

                           

                          Is the database that you are importing FROM open?  If it is, you also have to find all records in that database.  Better to import from a closed file.

                           

                          How will your script find the file that it is importing from?  Have you designated the file path?  Or will the user select the file?

                           

                          Each table import has to have it's own import settings saved.  If you are importing without the dialog, the import step must have both the target table and the source table saved for each import.  And you must be on the layout for the target table to import into it.

                           

                          Take a screen shot or print your script and post it as a PDF file to the forum.  Provide as many details as possible.

                           

                          Karen

                          • 10. Re: Import does not seem to go to the layout that I want to use
                            RoelfW

                            Hi Karen

                             

                            Thanks - my comments and responses in italitics and screen shots below

                             

                            By chance, are you using the same script step for each import?  You cannot do this.  Each table must have it's own import script step. 

                             

                            Actually the structure that I have is a master script that calls 4 separate scripts that each deal with one table.

                             

                            It might help you to step through the import process WITHOUT using a script - that is go to each table and choose import records from the file menu.  After each successful import, create a new script for that table and save the settings - they should default to the last import you did.  Then you will have 4 import scripts - one for each table.  Then you can write a script for the button that calls each import script one by one.  That might make it clearer where you are going wrong.

                             

                            I tried this but am unclear about "save the settings" just how to do this.

                             

                            Some other suggestions:  You should post a screen shot of your script steps.  In addition, we need more details about what you are trying to do in order to help you.

                             

                            Here is the master script ...

                             

                            and here is the structure of each of the table import scripts

                             

                             

                             

                             

                             

                            For example, what do you mean by an "earlier version of FM", exactly?  You cannot import records from a version with a different file extension.  So if you want to import .fp7 files from FM9 to FM 11, you are fine, because they both use .fp7 as the file extension.  But if  you are trying to import from .fp5 to .fp7 or from .fp7 to .fmp12 - this is not possible.

                             

                            Everything is FM12, so conversion is not an issue


                            Is the database that you are importing FROM open?  If it is, you also have to find all records in that database.  Better to import from a closed file.

                             

                            Get this so I am keeping it closed

                             

                            How will your script find the file that it is importing from?  Have you designated the file path?  Or will the user select the file?

                             

                            Right now I am asking them to select for each table

                            With the changes in W7 to do be able to simply copy the file path from the top of the Explorer dialogue, I will solve that problem later with a

                            help screen which educates my pretty naive users about how to copy a file path in W7

                            at that point I will add this additional functionality


                            Each table import has to have it's own import settings saved.  If you are importing without the dialog, the import step must have both the target table and the source table saved for each import.  And you must be on the layout for the target table to import into it.

                             

                            I have figured out how to save the settings for the target table, but I cannot see how to save the source table settings - what on the screen lets me to this

                             

                             

                            Take a screen shot or print your script and post it as a PDF file to the forum.  Provide as many details as possible.

                             

                            Karen

                             

                            Thanks for responding Karen

                            • 11. Re: Import does not seem to go to the layout that I want to use
                              RoelfW

                              I pasted the screen shots into the body of the reply but they don't appear

                              lets see if I can fix that

                               

                              Roelf

                              • 12. Re: Import does not seem to go to the layout that I want to use
                                RoelfW

                                Hi Karen

                                 

                                The script structure for a single table

                                 

                                the other are all the same with appropriate changes

                                 

                                the master script just calls them sequentially

                                 

                                Roelf

                                • 13. Re: Import does not seem to go to the layout that I want to use
                                  RoelfW

                                  Darn

                                  can't cut and paste an image into a reply

                                  well more to learn I guess about how to participate here

                                  have attached PDF file

                                   

                                  Roelf

                                  • 14. Re: Import does not seem to go to the layout that I want to use
                                    RoelfW

                                    I am getting tired

                                    the PDF is called master

                                    put is really a table level import script

                                    1 2 Previous Next