How to Reference $ Fields
Fields that start with a dollar sign are special Domino design elements that store values related to the management of the Lotus Notes documents. For example, the following are just a few of the dollar-sign fields that may be referenced.
- $KeepPrivate Disables the ability to copy, print, or forward a document
- $Moods Displays a mood graphic in an email
- $PublicAccess Sets access permissions
- $Readers Determines who can read the document
- $File Displays an entry for all file attachments
- $Link Shows an entry for all links
- $Revisions Shows the date and time for each document update
- $UpdatedBy Shows the list of users that have updated the document
How It Works
The tilde symbol is used to indicate that the following character is a special character.
ImplementationExample 1
This first example illustrates how to reference a dollar field using the tilde character. Without this prefix, you will receive a LotusScript error message at compile time.
Dim s As NotesSession Dim w As NotesUIWorkspace Dim uidoc As NotesUIDocument Dim doc As NotesDocument Dim db As NotesDatabase Set s = New NotesSession Set db = s.CurrentDatabase Set w = New NotesUIWorkspace Set uidoc = w.CurrentDocument Set doc = uidoc.Document '---------------------------------------------- ' Example statement using the tilde ' to reference a "$" field '---------------------------------------------- Msgbox doc.~$UpdatedBy(0)
ImplementationExample 2
This second example illustrates how to reference a dollar field using the GetFirstItem method from the NotesItem class to retrieve the item value (see Figure 13.12).
Dim s As NotesSession Dim w As NotesUIWorkspace Dim uidoc As NotesUIDocument Dim doc As NotesDocument Dim db As NotesDatabase Dim item As NotesItem Set s = New NotesSession Set db = s.CurrentDatabase Set w = New NotesUIWorkspace Set uidoc = w.CurrentDocument Set doc = uidoc.Document '---------------------------------------------- ' Example statement using the ' GetFirstItem method to reference ' a "$" field '---------------------------------------------- Set item = doc.GetFirstItem ("$UpdatedBy") Msgbox item.Text
Figure 13.12. Using GetFirstItem to return the value of the $UpdatedBy field
Note
Many of the dollar-sign objects are managed by Domino and cannot be modified.