Script.Exit()

Script.Exit() stops all script execution. Wherever the Script.Exit() occurs it will stop all script execution no matter how many sub-scripts you happen to be in.

Note: If you are in a function and want to exit the function but still continue the script, use the JavaScript return statement.

Applies To

Properties and Methods

None

Available

The .Exit() method is available in:

  • 15.03.016
  • All newer builds

Type

Method

Syntax

Script.Exit();

Parameters

None

Example

//--add this script to the save button on a form

if(!Event.Form.YesNo('Are you sure you want to save this record?'))

{

Script.Exit();

}

Event.Base();

 

/* Expected Prompt Response:

If the user answers no to the prompt, then all script execution stops, including calling the base function of saving the record.

The result of a 'No' response is that the record is not saved.

*/

Keyword Link IconScript Object - Properties and Methods