|
|
If you look for the cause of an error, it's not always the obvious - like in this case:
The following LotusScript function retrieves a Notes database filepath, a view name and title and prompt to show a picklist to the user, and display the user selection in a messagebox. Function handlePicklistResult(dbFilepath As String, viewName As String, dlgTitle As String, dlgPrompt As String) As Variant
On Error Goto errorhandler
Dim res As Variant
Dim ws As New NotesUIWorkspace
res = ws.PickListStrings( _
PICKLIST_CUSTOM, _
False, _
"", _
dbFilepath, _
viewName, _
dlgTitle, _
dlgPrompt, _
1 )
If Not Isempty(res) Then
Msgbox Join(res, "")
End If
e:
Exit Function
errorhandler:
Msgbox "Error " & Error & " in line " & Erl
Resume e
End Function
Now, the code results in the following error: Error Notes Error - Incorrect argument: non-null string expected in line 16
Can you guess why (it's in the parameters...)? It could be, that dbFilepath is not set, but it is... It could be, that the viewName is not set, but it is... So what is it? It's the title and the prompt! PickListStrings does not allow an empty title or an empty prompt. If you do not want to show a title or a prompt, you have to use at least a space character... About the AuthorMarcus Foerster works as Systems Architect for Pentos AG in Munich, Germany. His focus lies on the application side, creating collaboration systems for users, groups and enterprises to get their daily work done. This approach includes integrating complex workflows with intuitive user interfaces, using Lotus Notes/Domino with Adobe Flex and other Web technologies. Read more in Marcus' blog: http://marcus.foerster.com/blog |