Subject: How to get the value of a formula field in script?
As far as I know, if you try to access a Notes Item of type Formula, using the backend classes, to get to its value, all you will get is an empty string.
To get to the actual value you will have to use the frontend classes. The below method is not pretty, but will work. You will have to, first, create a Form and, then, create the $FilterFormula fields. Next, using LotusScript, you get a handle to the calendar profile, copy all the items to a new document, render the document using the form, launch the document in the UI and then use FieldGetText. Now, depending on what your end goal is, the below method may or may not help you at all.
--------Dim s As New NotesSession
--------Dim db As NotesDatabase
--------Dim doc As NotesDocument
--------Dim wSpace As New NotesUIWorkspace
--------Dim uiDoc As NotesUIDocument
--------Set db = s.CurrentDatabase
--------Set doc = db.GetProfileDocument(“CalendarProfile”)
--------Dim nDoc As New NotesDocument( db )
--------nDoc.Form = “tmp”
--------Call doc.CopyAllItems( nDoc )
--------Set uiDoc = wSpace.EditDocument( False, nDoc )
--------Dim textValue As String
--------textValue = uiDoc.FieldGetText( “$FilterFormula_0” )
--------Call uiDoc.Close
--------Msgbox textValue