Global Variables in Lotus Script

40 pts.
Global Variables
Lotus Domino
Lotus Domino 7.0.1
Lotus Notes Script
Lotus Script
I need to transfer 4 pieces of data from a dialog box form (generated by lotus script) back to the primary form.  

For consistency , I am not using the standard Cancel/OK buttons of the dialog box and since OK is not pressed, the dialog box data is not returned to the primary form.  

Is there a way to programattically use lotus script to indicate the OK button has been pressed (or whatever) so data is automatically transferred back to the primary form?


Can lotus script code be added to the standard OK button and/or the button renamed?


Is it possible to set a temporary global variable in the dialog box form button code and then used in the primary form when the dialog box is closed?  

I would rather not use the application's profile doc.

Software/Hardware used:
Domino 7.0.1

Answer Wiki

Thanks. We'll let you know when a new response is added.


I use to pass a NotesDocument in parameter of the DialogBox method of NotesUIWorkspace.

1) you create the NotesDocument (called here docGhost)
set docGhost = db.CreateDocument
2) you set the fields (with same names that in your dialogbox form) with default values
docGhost.Field1 = 0
docGhost.Field2 = “Your text value”
3) you call the DialogBox method with specifying docGhost in paramater
4) when you are back from your dialogbox, you can work with the new value of the fields

If ws.DialogBox(“YourDialogBoxFormNameHere” ,True,True,False,False,False,False,”Your title here”, docGhost ) = True Then
If docGhost.Field1(0) = 0 Then
Messagebox “bla bla” , 48 , “Title”
End if
If docGhost.Field2(0) = “Your text value” Then
Messagebox “You did not changed anything !” , 48 , “Title”
End if
end if

And if you really can’t use the default “Ok/Cancel” button, you could use the DialogBoxCanceled property of the dialogboxform and then set some environment variable in the Notes.ini and use these values later in you primary form (read then with notesSession.GetEnvironmentValue )

‘ In the QueryClose event of your dialogbox form
If not uidoc.DialogBoxCanceled then
Call notesSession.SetEnvironmentVar( “YourDlgField1” , doc.Field1(0) , False )
Call notesSession.SetEnvironmentVar( “YourDlgField2” , doc.Field2(0) , False )
end if

Discuss This Question:  

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: