AnsweredAssumed Answered

Server (15) import script not working

Question asked by TVBOTC on Sep 29, 2016
Latest reply on Sep 29, 2016 by TVBOTC

I have the following script in my Reference tables database.  A script runs from another database first that exports the records. When I run it manually from my desktop, it works perfectly.  When I run it from the server, I get no errors in the log, but end up with way more records than are in the .csv file (912) and most of them have empty fields, except for the auto enter.  I added a find to search for "=" in a key field and it still doesn't work.  I'm thoroughly stumped.



Set Error Capture [ On]


#import OPEN workorders the ALL workorders from WorkOrdersCombined

#Files created in Perform Export for ERP script

Go to Layout [ “OpenWorkOrders” (OpenWorkOrders) ]

Set Variable [ $openWO; Value:"filewin:" & Get(DocumentsPath) & "openWO.csv" ]

Import Records [ Source: “$openWO” OR “filewin:/E:/Program Files/FileMaker/FileMaker Server/Data/Documents/openWO.csv”; Target: “OpenWorkOrders”; Method: Add; Character Set: “UTF-8”; Field Mapping: Source field 1 import to OpenWorkOrders::WO_ID

Source field 2 import to OpenWorkOrders::WO_Type Source field 3 import to OpenWorkOrders::Status_CD ] [ No dialog ]

If [ Get ( FoundCount ) > 0 ]

    Show Omitted Only

    Delete All Records [ No dialog ]

    Perform Find [ Specified Find Requests: Find Records; Criteria: OpenWorkOrders::WO_ID: “=” ] [ Restore ]

    If [ Get ( FoundCount ) > 0 ]

       Delete All Records [ No dialog ]

    End If

    Show All Records

End If


P.S. Attaching .csv and an export of what ended up in OpenWorkorders