3.27

@@PromptIf

Use @@PromptIf when you want prompts to appear only when a specific condition is met. @@PromptIf behaves in all respects identically to @@Prompt, but also allows you to specify a test condition. The prompt only appears when the test is true.

Syntax: 

@@PromptIf(<token name>, <question>, <data type>, <list>; <range>, <default value>, <test>)

Parameters:

<name>

A unique name you give the prompt. Case sensitive and cannot include spaces.

<question>

The question or statement you want to appear in the window presented to the user when he or she generates the policy. Cannot include any punctuation. Each question must be unique. You can nest prompts for readability by including a pipe | in the question to create a hierarchical structure in the prompt window.

<data type>

The type of data you are asking the user to input. Possible data types are:

CHKB

display two check boxes labeled Yes and No the user can tick. Checkboxes automatically default to No unless otherwise specified in the <default value> parameter.

LIST

displays a drop-down list the user can select from. If specifying this data type, you must also define the <list> parameter.

TEXT

displays a text field where the user can type in alphanumeric text.

<list>

If <data type> is LIST, specify list contents here. Each list item is separated by a comma.

<default value>

Lets you set the <data type> default value. When setting the default value for a checkbox, you must also include <list> as an empty parameter. For example, CHKB, ‘’, ‘Y’. If left out, CHKB defaults to No, LIST defaults to the first item in the <list> parameter, and TEXT defaults to an empty field.

<test>

The desired test condition. The prompt only appears when the test condition is true.

When testing on a string (non-numeric value), enclose the data in single quotes. When testing on a number, do not use single quotes.

Use Or and And for testing multiple conditions. Or evaluates to true when any of the conditions are true. And evaluates to true only when all of the conditions are true.

You can use any of the following test conditions:

=

equals

<>

does not equal

<

less than (only allowed with numeric data)

>

greater than (only allowed with numeric data)

Example

The following statement displays the retirees age 65 covered prompt only when the token #MDSLPolicy.IsRetireeCovered is Y.

@@PromptIf(‘IsRetireeCoveredAge65’, ‘Are Retirees age 65 and over covered’, CHKB, '', 'Y', #MDSLPolicy.IsRetireeCovered = ‘Y’)

Output