nonTransactionalCreation_bare-2026-11-30T14-36-59-539Z

From the guide More ways to move your scripts.

← ai2fm Guides · Download nonTransactionalCreation_bare-2026-11-30T14-36-59-539Z.fmscript

# ⚠️ The name in parentheses after a layout is the LAYOUT NAME repeated, not the layout's base table occurrence.
# FileMaker shows the base table there. A script does not carry it — the clipboard and FileMaker's own SaXML both hold only the layout's id and name — so it cannot be recovered. Pasting is unaffected: FileMaker resolves the layout by name and assigns the table itself.
# Turn this off in the extension settings once you have read it: fmClipboard.warnLayoutTableOccurrence
Freeze Window
Enter Browse Mode [ Pause: Off ]
Set Variable [ $total[1] ; Value: 1000 ]
Set Variable [ $counter[1] ; Value: 1 ]
Go to Layout [ “myTable” (myTable) ]
Adjust Window [ Resize to Fit ]
Truncate Table [ With dialog: Off ; Table: “myTable” ]
Set Variable [ $startTime[1] ; Value: Get ( CurrentTimeUTCMilliseconds ) ]
Loop [ Flush type: Always ]
New Record/Request
Set Field [ myTable::PrimaryKey ; Get ( UUID ) ]
Set Field [ myTable::__pkMyTableID ; $counter ]
Set Field [ myTable::myField ; "auto-generated " & $counter ]
Set Variable [ $counter[1] ; Value: $counter + 1 ]
Exit Loop If [ $counter > $total ]
End Loop
Commit Records/Requests [ Skip data entry validation ; With dialog: Off ; Force Commit ]
Set Variable [ $endTime[1] ; Value: Get ( CurrentTimeUTCMilliseconds ) ]
Set Variable [ $elapsedTime[1] ; Value: ( $endTime - $startTime ) / 1000 ]
Go to Layout [ “myTableWithFields” (myTableWithFields) ]
Adjust Window [ Resize to Fit ]
Show Custom Dialog [ Title: "Success"; Message: $total & " Records Created at " & $elapsedTime & " seconds"; Default Button: "OK", Commit: "Yes" ]
Exit Script [ Result: JSONSetElement ( "{}" ; [ "success" ; 1 ; JSONNumber ] ) ]