Notes Ninjas Notes Ninjas
Lotus Notes hints, tips, error messages
Lotus Script abbreviated/shortened form and $fields

Hint Short Cut: Add this to your code & documentation to help you find this page.
http://www.notesninjas.com/#LSandDollarFields or http://www.notesninjas.com/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.

 

 Jump to:     Notes Tips
    Lotus Notes Index 
  Register for Tips
Previous Lotus Notes Tip 
    Next Lotus Notes Tip
Your company logo here?
Adam Foster
Free Cash Making Web Site
Free Revenue Earning Blog Site
 Free Revenue Earning Newsletter Site   
Free Search Pages Free Web stats
Free Contact Us page
Cheap .com domain names
 Need a website or 
   Lotus Notes
  problem solved?
Adam Foster
man and boy by Tony Parsons
British book of the year 2000. Great book, hard to put down, but I nearly threw it away half way through. You'll know why when you read it.
See at: Amazon.co.uk | Amazon.com |