Domino Code Fragment

Code Name*
Filling Items with Dialog Box on Open of Document!
Date*
04/29/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.18.116.62.45
Description*
Filling Items with Dialog Box on Open of Document!
Type*
LotusScript
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
If you compile using 4.5 or higer and try this on a 4.1x machine you will get an invalid number of arguments error.
Files/Graphics attachments (if applicable): Code:
1. Design another Form for "Formname" named "DialogFormname"
2. Create a layout region (Create - Layout Region - New Layout Region)
3. Create fields inside the Layout Region with exactly the same names as the fields
   on the form.
4. Create any supporting text and graphics inside the layout region. Set the "Show Border"
   property to off and the "3D" style" property to on.
5. In the Form attach a script that calls the Dialogbox method with "DialogFormname",True,
   True for parameters.
6. Attach the script in the PostOpen event for the "Formname" form

 Dim workspace As New NotesUIWorkspace
     'Check to make sure source is a new document
    If source.IsNewDoc Then

          'Place dialogbox on screen  
         If workspace.DialogBox("DialogFormname dialog box", _
         True, True) Then

               'saves values if user closes document and field is filled in
              If source.FieldGetText("MyField") _
              <> "" Then
                   Call source.Save
              End If
         End If
    End If