There is a form that, when launched, I would like an initial dialog box to pop up to collect some preliminary information prior to the user gaining access to the entire form. Additionally, I would like the same dialog to be presented when the user closes/saves the document to verify these fields maintain the correct information. Can you help direct me in the best way to do this? I'm sure script is the best way to go, but I'm new to...
scripting so this is a bit of a challenge for me. And help would be appreciated. The principle of popups, assuming we are speaking here about a Notes interface, is that information entered in fields in these popups can automatically be inherited into the main form from which the popup was called. This is done by using the @DialogBox function, which is exhaustively described in the Designer Help file. Sometimes it is easier to do these things with LotusScript.
I have attached some example code below, to give you a head start. It is important to remember that when you "dialog" a form using LotusScript, you will need to create a document object as well, to be able to read the values the user enters. If you do not do so and do not use this object in the calling method (see below), you would not be able to read any values entered by the user using LotusScript. The method dialog box of the notesUiworkspace, takes a value for a LotusScript NotesDocument object, which will then take the values entered. This method returns a true or false, related to the equivalent [OK] and [Cancel] button on the dialog box that appears to the end user. This allows you to trap if the user actually pressed the [OK] button and, if so, use the data from the dialog box to fill in or process your current document.
Dim s as New notesSession
Dim w as new notesUiWorkspace
Dim db as notesDatabase
Dim tmpDoc as notesDocument
Set w=New notesUiworkspace
'open dialog box to enter details for reversing activities
dlgFlag = w.DialogBox( "dlgReverse", True,True,False,False,False,False, "Reversing Activities",tmpDoc,True,False)
If dlgFlag Then
'do your thing on the calling document
Related Q&A from Hans van der Burg
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.