AnsweredAssumed Answered

Scripted Export in Runtime Upgrades

Question asked by NaturSalus on Dec 13, 2012
Latest reply on Dec 13, 2012 by 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

Outcomes