I have the following script:
Freeze Window
Go to Layout [ “Settings” (Settings) ; Animation: None ]
Set Error Logging [ On ]
Set Error Capture [ On ]
Set Variable [ $Path ; Value: Get ( DocumentsPath ) & "StudentsFromPowerSchool.csv" ]
Set Variable [ $host ; Value: “###:##” ]
Set Variable [ $creds ; Value: "--user ###:### --connect-timeout 10 --max-time 600" ]
Set Variable [ $fname ; Value: "CompleteStudentData.csv" ]
Set Variable [ $URL ; Value: "sftp://" & $host & "/~/Powerschool/" & $fname ]
Insert from URL [ With dialog: Off ; Target: Settings::LatestSchoolBrainsImport ; $url ; cURL options: $creds ]
Pause/Resume Script [ Duration (seconds): 5 ]
Set Variable [ $LastError ; Value: Get ( LastError ) & " " & Get ( LastErrorDetail ) ]
Create Data File [ “$Path” ; Create folders: Off ]
Open Data File [ “$Path” ; Target: $fid ]
Pause/Resume Script [ Duration (seconds): 5 ]
Write to Data File [ File ID: $fid ; Data source: Settings::LatestSchoolBrainsImport ; Write as: UTF-8 ]
Pause/Resume Script [ Duration (seconds): 5 ]
Close Data File [ File ID: $fid ]
Set Variable [ $fileID ; Value: "" ]
# FileMaker does funky stuff with container data stored by reference in variables, so it's best to clear this global _after_ exporting the data above.
Set Variable [ $! ; Value: Evaluate ( "Let ([ " & $containerDataVarName & " = \"\" ]; \"\" )" ) ]
Go to Layout [ “Import_Student” (Import_Student) ; Animation: None ]
Show All Records
Delete All Records [ With dialog: Off ]
Import Records [ With dialog: Off ; Table: Import_Student ; “$Path” ; Add; UTF-8 ]
Go to Layout [ “Import_Student” (Import_Student) ; Animation: None ]
Show All Records
When I run it locally it has no problem. It downloads the 20MB file to a container, writes it to hard drive and imports all 16k records. When I run it on the server it only imports between 2000 and 2,300 records (different random number every time).
I tried putting the waits in and increased the max-time from 60 to 600 and got the same result.
Any thoughts on what’s going on? My desktop client is 22.0.2, but the server is on 21.0.2.202, since I didn’t want to put 22 into production until I waited to see what it did.