Subject: Need some help with LotusScript
I remember those feelings. I have found the best help to be the Notes on-line documentation. In my designer, the home page shows the Domino Objects for LotusScript and OLE. From there it is easy to click on an object and learn what properties and methods are available to me. Don’t forget that F1 brings up the designer help (if in designer when pressing F1). Alt+2 puts it in index order for view-like searching.
A couple of tricks I have found that helped me.
In the (Globals)Declaration area of your form (it is at the top of the list, you usually have to click on the plus key to show it), Dim two objects:
Dim UIDoc as NotesUIDocument
Dim Doc as NotesDocument
Then in the form’s PostOpen event, set these objects
Set UIDoc = Source
Set Doc = UIDoc.Document
By declaring those objects as public and setting them in the PostOpen event, they are always available to you; in a field’s Entering and Exiting event, in any button or action you create for the form, basically anywhere.
From there study the help about how to get to the fields and data. From the UIDoc use var = UIDoc.FieldGetText(“Fieldname”) and Call UIDoc.FieldSetText(“Fieldname”, value). From the Doc use var = Doc.Fieldname(0) and Doc.Fieldname = var. Remember that UI refers to what the user sees (“front-end”), so the UIDoc is what is displayed on the screen, while Doc is the “back-end” or what is stored on disk. This is important when working with fields which contain synonyms, i.e. Texas|TX. The UIDoc would return “Texas” while the Doc would return “TX”.
The other thing to remember is that Notes considers all fields to be an array of data. Therefore to get the data from a field on a document, it is var = Doc.Fieldname(0).
Good luck and enjoy. While LotusScript is powerful and even fun, don’t forget the Formula language. In the right circumstances a few formula commands can be faster than comparable script code.
–Ron