In some cases, you may want to prompt the user to confirm that he or she really wants to continue before performing an action. For example, say the application includes a button to change the status of the document or to send an email. This routine illustrates how to prompt the user with a message such as "Are you sure?" before continuing with the transaction.
How It Works
The @Prompt function can be used to return a trUE or FALSE value. When combined with the @IF statement, you can determine what action (if any) should be taken based on the user's response to the question.
To implement this solution, create an action button on a form, view, or page. Insert the following code. Replace the @Prompt statements with commands to be issued based on the Yes or No response (see Figure 14.19). For example, if the user selects Yes, issue the @MailSend command.
result := @Prompt([YesNo]; "Continue?"; "Do you want to continue?"); @If (result = @True; @Prompt([Ok]; "Result"; "You selected YES."); @Prompt([Ok]; "Result"; "You selected NO."));
Figure 14.19. Example "Do you want to continue?" prompt
A similar implementation can also be achieved using LotusScript. Refer to Chapter 13 for additional information pertaining to this subject.
An Introduction to the Lotus Domino Tool Suite
Getting Started with Designer
Navigating the Domino Designer Workspace
Domino Design Elements
An Introduction to Formula Language
An Introduction to LotusScript
Fundamentals of a Notes Application
Reference Library Applications
Design Enhancements Using LotusScript
Design Enhancements Using Formula Language
Miscellaneous Enhancements and Tips for Domino Databases
Application Deployment and Maintenance
Appendix A. Online Project Files and Sample Applications
Appendix B. IBM® Lotus® Notes® and Domino®Whats Next?