AnsweredAssumed Answered

Issue with Export Script

Question asked by NaturSalus on Feb 22, 2013
Latest reply on Feb 28, 2013 by philmodjunk

Title

Issue with Export Script

Post

      

     Hello,

     I have the follwoing Export script that is triggered by the user from a button,


      

# Error Handling

     Allow User Abort [ Off ]

     Set Error Capture [ On ]

# Setting File Path

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

# Export Appointment records

     Go to Layout [ “Appointment_Detail” (Appointment) ]

     If [ Get ( FoundCount ) ≠ 0 ]

     Show All Records

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

     Appointment::_kf_Patient

     Appointment::AppointmentDate

     ...

     [ No dialog ]

     End If

# Export Patient records

     Go to Layout [ “Patient_Detail” (Patient) ]

     If [ Get ( FoundCount ) ≠ 0 ]

     Show All Records

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

     Patient::PatientNameFirst

     Patient::PatientNameFirstLast

     Patient::PatientNameLast

     …

     [ No dialog ]

     End If


      

     following the same strategy the next tables are exported


      

# Export ManufacturerMedicine records

     Go to Layout [ “dev_ManufacturerMedicine” (ManufacturerMedicine) ]

     If [ Get ( FoundCount ) ≠ 0 ]

     Show All Records

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

     __Kp_ManufacturerMedicine

     ManufacturerMedicine::_Kf_Manufacturer

     ManufacturerMedicine::_Kf_Medicine ]

     [ No dialog ]

     End If

     Go to Layout [ original layout ]


      

     I have run the Export script through the debbuger and is seems to work fine and no errors showed up. However, when I try to import manually the exported file from an empty application the only fields listed in the Import File Mapping Window are those ManufacturerMedicine table that is the last table that was exported.

      

     To be able to see what was exported, I exported to a .cvs file instead of to a .merg file and I could check that export file contained only the records of the ManufacturerMedicine table. This is telling me that there is a mistake in my Export script.


     Where is my mistake?

      

     Thanks,

      

     natursalus

import_Screen.jpg

Outcomes