The $KeepPrivate field is a special Lotus Notes field that manages the ability to copy, print, and forward documents in a database. When enabled, the associated menu options and shortcut keys are disabled. This prevents the user from performing any of these actions. This feature is often implemented as a means to manage the dissemination of information.
This is a built-in feature of the Lotus Notes client. Users will not be able to copy, print, or forward any document that includes the $KeepPrivate field where its value is set to a text string "1".
This field does not prevent users from reading the document. To manage who can read a document, consider implementing the $KeepPrivate field in conjunction with a Readers field. See Chapter 19, "Security," for additional information pertaining to document security.
This feature can be implemented by using static or dynamic field values. When implemented with a static value, the copy, paste, and print functions are disabled for all documents, and the setting cannot be changed. Using a dynamic approach, the setting can be toggled between enabled and disabled by using a checkbox, radio button, action button, and so on.
This first example illustrates the static approach. To implement this technique, complete the following instructions.
Create a field on the form.
In the field properties dialog, name the field $KeepPrivate and set the field type to either Computed or Computed when composed.
In the Programmers pane, insert the following formula in the Value section for the field.
This second example illustrates the dynamic approach. This approach will allow users to enable or disable the copy, paste, and print features on a document-by-document basis. To implement this technique, complete the following instructions.
Create a field on the form.
In the field properties dialog, name the field $KeepPrivate and set the field type to Checkbox and Computed. Switch to tab 2. Select the Enter choices (one per line) option and add this formula to the field properties dialog (see Figure 17.1).
Prevent copying and printing | 1
Figure 17.1. Example field choice setting to disable copying and printing
This will produce a field on the form that looks like Figure 17.2.
Figure 17.2. Example of the disable copying and printing checkbox
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?
Lotus Notes Developers Toolbox: Tips for Rapid and Successful Deployment
Authors: Mark Elliott
Similar book on Amazon
XPages Portable Command Guide: A Compact Resource to XPages Application Development and the XSP Language