Code Samples for Edit and Compose Buttons That Test That a Proper Document/Form is Selected

Mindwatering Incorporated

Author: Tripp W Black

Created: 03/09/2005 at 08:54 PM

 

Category:
Notes Developer Tips
Formulas

Code for "smart" edit button to test that a document is selected (rather than a category):
@If(Form=""; @Prompt([Ok]; "Oops"; "Select a document, not a category.");
@Command([EditDocument]))


Code to verify that correct document (form) is selected before creating a new doc:
@If(Form="Policy"; @Command([Compose]; "Q");
Form=""; @Prompt([Ok]; "Sorry"; "Select a Policy document, not a category.");
@Prompt([Ok]; "Sorry"; "You can create a Question only from a Policy"))

previous page