< Back

Document Subject: Lotus Script abbreviated/shortened form and $fields
Hint Short Cut: Add this to your code & documentation to help you find this page.
http://#LSandDollarFields or http://A555F9/nn.nsf/ByAlias/LSandDollarFields

In LotusScript you can access a document's field value using the shortened or abbreviated form: doc.fieldname(0). With dollar fields this doesn't work. Here's is a top tip to get around it.




Doc.NameField = "adam" will work but

doc.$KeepPrivate = "0" will not even compile/save.

NB $KeepPrivate prevents a document from being copied or printed.

Try using doc.~$KeepPrivate = "0" instead.

 

Here is  the code for an action button "Allow Copy" I have in my administration views.

 

     Dim s As New notessession
     Dim db As notesdatabase
     Set db = s.currentdatabase
     
   Dim col As notesdocumentcollection
     
   Dim doc As notesdocument
     Set col = db.unprocesseddocuments
     
   Set doc = col.getfirstdocument()
     Do Until doc Is Nothing
          doc.~$KeepPrivate = "0"
          Call doc.save(False,False)
          Set doc = col.getnextdocument(doc)
    Loop

This of course works with $ref. You use doc.~$ref(0) etc.

You can put a tilde anywhere in a field name in lotusscript and it is ignored apparently, discovered by Doug Tait after a typo.