1 2 Previous Next 16 Replies Latest reply on Jun 5, 2012 3:14 PM by philmodjunk

    Exporting a single record to another fm solution

    AlexTorry

      Title

      Exporting a single record to another fm solution

      Post

      Hello,

      I have two identicall filemaker solutions I wonder how can I script the following:

      Being in a record, i want to add a button to export that record and all of the related fields to it into the other filemaker solution.

      First I tought it was going to be an easy job but i just cant figure it out....

      Is this possible and let's say "automatic" so by just clicking on that button the record appears in the other database just as it is on the first one?

      Thanks in advance for your help

        • 1. Re: Exporting a single record to another fm solution
          philmodjunk

          This can be done by isolating your current record in foundset of just that one record, then you go to the other database and import that record.

          This will only import the current record from the layout's table. If by "related fields" you mean that you have data in other related tables that muxt also be imported, you would need to set them up on layouts based on their table with foundsets restricted to just those records.

          This can all be done with scripting.

          Write a script in the other file that imports records from the first file into each such table.

          Write a script in the first file that isolates the records and then uses Perform Script to perform the script in the other file that performs the import records operation.

          • 2. Re: Exporting a single record to another fm solution
            AlexTorry

            It works perfect now thanks for your help, except that I tried doing this through the network and have the inconvenience that for every scrip ran on the other database it prompts me for username and password for the main database which is very annoying, I don´t know why this happens hence the file is already open and I am already signed in, I tried selecting the "run script with full access privileges" and still with that problem..... any ideas on how to solve this?

            I uploaded a screenshot of the script

            • 3. Re: Exporting a single record to another fm solution
              philmodjunk

              Have both files been opened by the user with exactly the same account name and password before you run this script?

              • 4. Re: Exporting a single record to another fm solution
                AlexTorry

                Yes, and still prompts me for username and password...

                • 5. Re: Exporting a single record to another fm solution
                  philmodjunk

                  Hmmm, that shouldn't happen. I can't read the language but If I deduced correctly, the highlighted script step is Perform Script. It should access the other file without triggering a password dialog. If the same account name and password is defined in both files, this scrpt should open the other file without requesting a password even if the file is closed at the time that the step is executed.

                  • 6. Re: Exporting a single record to another fm solution
                    AlexTorry

                    Sorry about the language but when I updated the software it downloaded it in spanish because of my location, it was kind of annoying for me too because I was used to script in english even though I sapeak spanish.

                    Back on the issue, that didn't happen to me before when both files were on the same computer but when I tried having this done through the network it started showing that dialog, let´s say I have to enter username and password for every import records scripted, funny because when closing the second file, which is the one that imports the records, it tells me that another user is using the solution on the network which is not true...

                    • 7. Re: Exporting a single record to another fm solution
                      philmodjunk

                      Open manage | external data sources and see what references have to the file that you moved. I'd make sure they are up to date and use "open remote" to access the other file. (Don't know which one was moved here or I'd be more specific.) Also check the import records step to make sure it is correctly accessing the file on the server. (Import records steps have their own file references.)

                      • 8. Re: Exporting a single record to another fm solution
                        AlexTorry

                        I have, the path is fmnet..... still the same

                        • 9. Re: Exporting a single record to another fm solution
                          philmodjunk

                          If you moved the file to a server, it's not going to be the same.

                          You have two files, file1 and file2. If you move file2, open file1 and check the references to file2. And if file2 contains the table the table from which you are importing the data, check the file reference in the import records step also.

                          These are the only checks, short of running a recover on your file to make sure it is undamaged, that I can think to make for this.

                          Import Records, on the other hand, is a script step that will trigger the password dialog even for files where the account name and passwords match, but only if the file from which data is to be imported is not open--not the case here as fara as I can tell.

                          • 10. Re: Exporting a single record to another fm solution
                            AlexTorry

                            When Moved file2 to the server, I re-scripted on both file1 and file2 so the program knew exactly where to get the data from, so for the file2(server) which is the one that holds the import scripts, I selected the correct path through the "remote" location of the file. (Here is when I first found a difference because when selecting th file while scripting it actually prompts me por a username and pasword, and when specifying which table to which it happend twice).

                            For file1 in order to triger the secripts on file2 you have to select the source for the other file scripts and so I did the same thing, located it through the remote option and works well, it actually shows the scripts on file2 even while being on the server.

                            So the whole thing works fine but for every time that the import script is triggered on file2(server) it asks for a username and password even knowing teh obvious fact that File1 is open because is the one triggering the whole thing....

                            Perhaps it tries opening the file remotely on the server or I don´t know but really frustrated....

                            • 11. Re: Exporting a single record to another fm solution
                              philmodjunk

                              Where is file 1 located? On a server or on your local machine?

                              Did you update the file reference in the import records step?

                              • 12. Re: Exporting a single record to another fm solution
                                AlexTorry

                                File 1 is on my local machine..... Yeah updated all the references to external files

                                • 13. Re: Exporting a single record to another fm solution
                                  philmodjunk

                                  Is Sharing enabled for FileMaker on your local machine? I've never tried the configuration you have here so I'm looking for any settings that might be a factor here.

                                  What do the file references to the local file from the hosted file look like? relative path? Fmnet:?, specific server name or ip address...?

                                  • 14. Re: Exporting a single record to another fm solution
                                    AlexTorry

                                    It will prompt for username and password because it is opening the file remotely.

                                    I think I have the same problem as http://forums.filemaker.com/posts/7d514249ca, aparently someone there says that you can have your script save the login info, is this possible?

                                    I need to automate the username and password entry for every import script that I have.....

                                    Please help

                                    1 2 Previous Next