Help

Table Of Contents
Creating scripts to automate tasks
F
ILEMAKER PRO HELP 444
4. Close the Edit Script window, then close the Manage Scripts dialog box.
If structure examples
If, Else If, Else, and End If script steps define a structure that controls whether or not script steps are
performed. This control depends upon the result of a testable condition or Boolean calculation.
When the calculation result is any number except zero, the condition evaluates to True, and
subsequent script steps are performed.
When the calculation result is zero, blank, or content that does not resolve into a number,
then the condition evaluates to False and the subsequent script steps are not performed.
Else If steps provide additional Boolean tests. Else steps provide alternative steps to perform if all
conditions evaluate to False.
Example 1
Performs a find. If no records are found, displays a custom dialog. If records are found, sorts the
found set.
Perform Find [Restore]
If [Get ( FoundCount ) = 0]
Show Custom Dialog ["Find Records"; "No records were found."]
Else
Sort Records [Restore; No dialog]
End If
Example 2
Performs a find. If no records are found, displays a custom dialog. If one record is found, goes to the
Invoice Details layout. If more than one record is found, goes to the Invoices layout.
Perform Find [Restore]
If [Get (FoundCount) = 0]
Show Custom Dialog ["Find Records"; "No record was found."]
Else If [Get (FoundCount) = 1]
Go to Layout ["Invoice Details"]
Else
Go to Layout ["Invoices"]
End If
Loop structure examples
Loop, Exit Loop If, and End Loop script steps define a structure that enables script steps to be
repeated. Script steps between a Loop and an End Loop are executed continuously, until an Exit
Loop If condition or an Exit After Last condition is reached for a Go to Record/Request/Page or Go
to Portal step.
Use the Exit Loop If script step to specify a calculation to be evaluated. When the calculation result
is not zero, it evaluates to True and the loop ends. When the calculation result is zero, it evaluates to
False and the loop continues.
Example 1
Copies the contents of the Customers::Work Phone to Customer::Day Contact in all records.
Go to Record/Request/Page [First]
Loop