|
||||
Requires Free Membership to View
Register today to access targeted resources from our editorial writers and independent industry experts focused on Lotus Domino, Notes, Workplace and other related technologies.
To display a customized message box, you first must create a button on any Lotus Notes form that will call another Messagebox or Dialogbox. Then write the following code in an on-click event.
Note: This code can also be used in an agent, if needed.
Sub Click(Source As Button) Dim session As New NotesSession Dim workspace As New NotesUIWorkspace Dim db As NotesDatabase Dim tempdoc As Notesdocument Set db = session.currentdatabase Set tempDoc = db.CreateDocument Call workspace.DialogBox( "msgBoxCloseAuto", True, True, True, True, False, False, "MessageBox Closing",TempDoc, True,True ) End Sub
After writing the code, follow these steps:
- Create another form called msgBoxCloseAuto.
- Enable the option "Automatically refresh fields."
- Create a button and place it in a table.
- Write the message that you want to be displayed in the button text.
- Write the following code on the Postrecalc event of the msgBoxCloseAuto form.
Sub Postrecalc(Source As Notesuidocument) Sleep 3 source.close End Sub
This will display the second form as a Messagebox or Dialogbox, depending on which you select, and will close automatically after three seconds.
Do you have comments on this tip? Let us know.
This tip was submitted to the SearchDomino.com tip library by member Vinay Sharma. Please let others know how useful it is via the rating scale below. Do you have a useful Lotus Notes, Domino, Workplace or WebSphere tip or code snippet to share? Submit it to our monthly tip contest and you could win a prize.
This was first published in August 2008