I am attempting to populate the choices on a Notes Form Listbox using Lotusscript. My theory being. In the doc Onload event I retreive my data from a View adding it to a hidden field. I then use that field as the choices selection formula for the Listbox.
My thinking seems correct as if I use @FontList in the hidden field then all the fonts are available in the Listbox, but using the script below the Listbox options are blank despite both methods producing a field with Data Type: Text List
Maybe I can't populate the choices using Onload in this way so, any suggestions on how to dynamically populate the choices of a Listbox using Lotusscript would be appreciated.
Many thanks
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim col As NotesViewEntryCollection
Dim entry As NotesViewEntry
Dim item As NotesItem
Dim doc As NotesDocument
Dim coName As String
Set db = session.CurrentDatabase
Set view = db.GetView("All Customers")
Set col = view.AllEntries 'This will be subset if I can get it working
Set entry = col.GetFirstEntry
Set doc = Source.Document
Set item = doc.GetFirstitem( "FieldToStoreChoices" )
While Not (entry Is Nothing)
coName = entry.ColumnValues(0)
Call item.AppendToTextList( coName & ";")
Set entry = col.GetNextEntry(entry)
Wend