Script Steps Reference

Table Of Contents
Control script steps
F
ILEMAKER SCRIPT STEPS REFERENCE 20
Example 2
Prints unpaid invoices. In the Print sub-script, users can choose whether they want to print invoices.
If users choose to print, then Exit Script uses a script result to enter “Printed on <current date>” in
the Status field.
Main script: Print Unpaid Invoices
New Window [Name: "Invoice List"; Style: Document]
Go to Layout ["Print Invoices"]
Perform Find [Restore]
#Calls the "Print" sub-script defined below
Perform Script ["Print"]
#Continues after the sub-script is completed
If [Get ( ScriptResult ) = 1]
Replace Field Contents [No dialog; Invoices::Status; "Printed on " &
Get ( CurrentDate )]
Else
Show All Records
Sort Records [Restore; No dialog]
End If
Sub-script: Print
Show Custom Dialog ["Print Unpaid Invoices"; "Do you want to print
unpaid invoices?"]
If [Get ( LastMessageChoice ) = 1]
Print [No dialog]
Else
Close Window [Current Window]
End If
#Uses the Result parameter to pass the user’s choice to the main script
Exit Script [Result: Get ( LastMessageChoice )]