APPLICATION DESIGN


Designing a form that prompts users for information
You can design a form that uses @Prompt to request information from users to help them fill out a document. This function is similar to @DialogBox, but it is simpler: @Prompt contains only text and doesn’t interact with any other forms.

1. Create a form.

2. Create a button, hotspot, or action that will store the @Prompt formula.

3. Click the button, hotspot, or action.

4. In the Objects tab on the Info list in the Programmer’s pane, select the Click method for the button, hotspot, or action.

5. In the Script area of the Programmer's pane, enter an @Prompt formula.

6. Save and close the form.

Examples: Using @Prompt

[YesNoCancel]
This formula displays a warning before a memo is sent, giving users a chance to select Yes, No, or Cancel.

Result := @Prompt([YesNoCancel]; "Send memo?"; "This memo will be sent to everyone listed in the To, CC, and BCC fields." );

[OkCancelEdit]
This formula fills the Name field with the user’s response to the prompt. The default value is the user’s IBM® Lotus® Notes® name. If the user selects Cancel, Notes cancels the formula evaluation.

FIELD Name := @Prompt([OkCancelEdit]; "Enter Your Name"; "Type your name in the box below."; @UserName);

[OkCancelList]
This formula captures the user’s response in a temporary variable called ComposeType and uses it to create a new report using the appropriate form.

ComposeType := @Prompt([OKCancelList]; "Report Type"; "Choose a report type."; "Adjustment Report";"Adjustment Report":"Infant Progress Report":"Toddler Progress Report":"Preschool Progress Report":"Transition to Kindergarten Report");
@Do(@Command([Compose]; ""; ComposeType));

See Also