SnTT: Forgotten LotusScript: NotesUIWorkspace.Prompt
August 7th, 2008 by Corey Davis
From time-to-time I have come across Notes applications that customers have written that ask the user for another database. Usually this is done to export data or because some type of processing must take place against this other data source. For whatever reason this is being done, the point which the user is asked for the other database this is what the user is prompted with:

Yikes! Seriously? Maybe an admin or developer will know the database’s full path and file name, but rare is the user that could answer that question. That is were NotesUIWorkspace.Prompt comes to the rescue!
While users may not be able to supply a database path and file name (or database link if you try to go that route), they all know how to use the Open Database dialog. So why not give them something that they already know?
By using the NotesUIWorkspace.Prompt method you can display a familiar means for your users to find and select the database that they need. It is as simple as this:
Dim ui As New NotesUIWorkspace
Dim dbInfo As Variant
dbInfo = ui.Prompt(13, “”, “”)
By using type 13, or PROMPT_CHOOSEDATABASE, this will cause the Prompt method to display the standard Open Application dialog (Open Database in Notes 7 or below). When the user selects a database and presses the Open button what will be returned back to you is an array of three Strings:
0 = Server name (blank if on local)
1 = File path
2 = Database title
Regardless to the unfortunate dialog title of “Open Application”, the database will not be opened but instead an array of strings will be passed back to the calling code. It will be up to you to either take these and open the database or to store them in a form or whatever is appropriate for your application.
However you use it, this is a much better option then requiring your users to figure out how to supply the database information manually. When at all possible, always provide the easiest, most familiar solution for your users.
Tags: Domino, notes, Show-n-tell-thursday, sntt, useability
Posted in Domino, SnTT, 333 views,

Follow me on Twitter