Event.Form.YesNo(Message)

Event.Form.YesNo(Message) displays a DEACOM prompt at that specific point in the script and pauses script execution until the user responds to the prompt. The prompt displays two options for the user to respond: Yes and No. When the user clicks on a response, then the prompt returns a Boolean to the script. This is one of two ways to display information in a prompt for the user to see. The prompts for message boxes are stacked one on top of the other and displayed at the end of scripting execution. If you have multiple .MessageBox(Message) calls in a script, the user will see the last prompt first and as they clear the prompt move back to the first.

The .MessageBox(Message) is passive, while the .YesNo(Message) stops scripting execution to wait for a response from the user and returns a boolean to the script based on the response.

WARNING: Adding an Event.Form.YesNo(Message) to a script stored in an Event.Form.Variables will cause DEACOM Web Server to crash. This one among many other reasons why Deacom discourages storing functions in form variables.

Applies To

Properties and Methods

None

Available

The .YesNo(Message) method is available in:

  • 15.03.016
  • All newer builds

Note: The .YesNo(Message) method and all sub-classes, properties, and methods are only available in Form Layout scripts.

Type

Boolean

Syntax

Event.Form.YesNo(Message);

Parameters

Parameter

Required

Description

Message

Yes

The message displayed on the screen for the user to see

Example

//--Add this script to an add/edit form's record load event.

var lcMsg = 'Do you want to proceed?';

if(!Event.Form.YesNo(lcMsg)

{

Event.Form.MessageBox('Have a nice day...');

Script.Exit();

}

Event.Form.MessageBox('You made it to the end!');

 

/* Expected Prompt response:

Do you want to proceed?

Yes No

If the user clicks yes, they will see:

You made it to the end!

If the user clicks no, they will see:

Have a nice day...

*/