Set Error Capture
Suppresses or enables normal FileMaker Pro alert messages.
See also 
Set Error Capture [<on or off>]
On suppresses FileMaker Pro alert messages and some dialog boxes. If the error result is 100 or 803, then certain standard file dialog boxes are suppressed, such as the Open File dialog box.
Off re-enables the alert messages.
Where the script step runs 
FileMaker Pro 
FileMaker Server scheduled script 
FileMaker Go 
Custom Web Publishing 
FileMaker WebDirect 
Runtime solution 
Originated in 
FileMaker Pro 6.0 or earlier
Use this script step to handle errors in a manner consistent with the functions the script performs. By using the Get(LastError) function immediately after a script step, you can verify that the step was performed properly.
By using the Get (LastError) function with the control script steps, you can make sure your script performs correctly. When you decide to suppress alerts, it is important that you anticipate as many problems as possible and include clear instructions for what to do when an error condition is encountered.
Example 1 
Performs a find and suppresses the error dialog if no records were found.
Set Error Capture [On]
Perform Find [Restore]
Example 2 
Performs a find. If no errors occur, sorts records. If no find criteria were specified, shows all records. If no records match the find request, displays a custom dialog.
Set Error Capture [On]
Perform Find [Restore]
If [Get ( LastError ) = 0]
Sort Records [Restore; No dialog]
Else If [Get ( LastError ) = 400]
Show All Records
Else If [Get ( LastError ) = 401]
Show Custom Dialog ["Find"; "No records were found."]
End If
Related topics 
Script steps reference (alphabetical list)
Script steps reference (category list)