4 Replies Latest reply on Dec 13, 2012 9:33 AM by NaturSalus

    Scripted Export in Runtime Upgrades

    NaturSalus

      Title

      Scripted Export in Runtime Upgrades

      Post

            

           Hello,

           I have a runtime based on FM 11 and I would like to script the export of the user generated data, so that it can be imported later on through scripting from an upgrade of the runtime based on FM 12.

           I know that the most obvious question would be why not produce an FM 12 based runtime solution in the first place and just import directly from the upgrade the required records? But to me this is not a valid option due to the current problems with FM 12 v3.


           Since I haven't scripted an export before I have some doubts about what is the best way to do it.

            

           Let's imagine that with the FM 11 based runtime solution the user will be generating data in the People and Case tables.

           My idea is to have an Export script that on closing the FM 11 based runtime application automatically will create a file with data from the People and Case tables.

           Then, when the FM 12 based runtime upgrade is released, the user will be able to import he People and Case tables data by running the Import script.

            

           First question, what is the best export data format option

             
      •           

                       Tab-Separated Text

             
      •      
      •           

                       Comma-separated Text

             
      •      
      •           

                       Excel Workbooks (.xlsx)

             
      •      
      •           

                       other

             

            

           Second question, in writing the Export script I know how to go about exporting just one table records but not two or more.

            

           The way to go is to have the two Export Records scripts steps one after the other?

           For example, let's imagine that the best format option is CSV:


            

      # Export Case records

      Go to Layout [ “Case_Detail” (Case) ]

      Show All Records

      Set Variable [ $FilePath; Value:"file:" & Get(DesktopPath) & "AllRecords.csv" ]

      Export Records [ File Name: “$FilePath”; Character Set: “Windows (ANSI)”; Field Order: Case::__kp_Case

      Case::CaseDate

      here go the rest of the Case records

      [ No dialog ]

      # Export People records

      Go to Layout [ “People_Detail” (People) ]

      Show All Records

      Set Variable [ $FilePath; Value:"file:" & Get(DesktopPath) & "AllRecords.csv" ]

      Export Records [ File Name: “$FilePath”; Character Set: “Windows (ANSI)”; Field Order: People::__kp_People

      People::PersonLastName

      here go the rest of the People records

      [ No dialog ]

      #

      Go to Layout [ original layout ]


            

           Or is there another way of doing it?


            

           Thanks,


           natursalus

        • 1. Re: Scripted Export in Runtime Upgrades
          philmodjunk
               

                    I know that the most obvious question would be why not produce an FM 12 based runtime solution in the first place and just import directly from the upgrade the required records? But to me this is not a valid option due to the current problems with FM 12 v3.

               I understand your concern, but since you are wanting to import into an FM 12 runtime anyway, how does exporting the data to an intermediary file avoid any of those issues with FM 12?

               If I were to do a data only export from FileMaker for import into FileMaker, I'd specify the merge file format. This can make it possible to do a "matching field names" import--which greatly simplifies field mapping when setting up the import.

               And yes, you would export the data one table at a time with an export records step for each table.

          • 2. Re: Scripted Export in Runtime Upgrades
            NaturSalus

                 Hello Phil,

                 Thank you for looking into my question.

            I understand your concern, but since you are wanting to import into an FM 12 runtime anyway, how does exporting the data to an intermediary file avoid any of those issues with FM 12?

                 Depending on whether FM 12 v4 ever comes or not to light and how I might be forced not to use FM 12 at all and wait for FM 13.

            If I were to do a data only export from FileMaker for import into FileMaker, I'd specify the merge file format. This can make it possible to do a "matching field names" import--which greatly simplifies field mapping when setting up the import.

                 Interesting suggestion.

                 I have looked it up in three places (FMI Guide; Filemaker 12 In Depth; and Filemaker 12 Pro The Missing Manual) and all of them say something like: " the merge format is used for exporting word processor files".

                 Okay merge file format.

                  

                 natursalus

            • 3. Re: Scripted Export in Runtime Upgrades
              philmodjunk

                   That info is correct, it just neglects to tell you about this very useful additional use for this file format.

                   Merge files exports were originally created so that you could export data from Filemaker and then import it into MS Word so that you could use MS Word to generate "Form Letter" like documents from the exported data. But since the export generates a first row of all your file names (Spaces in your file names get changed into _ characters), it has other uses than just for import into word processors.

              • 4. Re: Scripted Export in Runtime Upgrades
                NaturSalus

                     Phil,

                     Thanks for sharing your vast knowledge about FileMaker.

                     natursalus