Domino Code Fragment

Code Name*
Updating a UIdoc in Read Mode with a DialogBox
Date*
04/28/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.3.149.229.253
Description*
For a variety of reasons, such as formatting, you want to keep a document in read mode, but you need to collect input from a user and update the document they are currently reading. In this example, we want to keep the user in read mode but update the document
Type*
LotusScript
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:

Sub Click(Source As Button)

'Declare Variables

Dim s As New NotesSession
Dim ws As New NotesUiworkspace ' Create workspace
Dim flag As Variant ' return flag
Dim doc As NotesDocument ' Notes Doc - backend document of UIDOC
Dim uidoc As NotesUidocument ' Notes UI Document
Dim db As NotesDatabase 'Current Databsae


Set db = s.CurrentDatabase ' Set the database object to current databse

Set uidoc = ws.Currentdocument ' Sets the uidoc to the current document
Set doc = uidoc.document ' Set the doc to the uidoc.

uidoc.editmode = True ' This sets the document in edit mode so the dialogbox can update the UIDOC

' Make sure you have the correct parameter set for updating a document from a DialogBox
flag = ws.DialogBox("installdialog","True","True","False","False","False","False","Advance Examples Install")

uidoc.save ' This saves the Uidoc with the new update froms the DialogBox.
uidoc.editmode = False
Call doc.Save(True, False) ' This saves the doc with the new updates from the UIDOC.
' You can references the new updates with: variable = doc.NewField(0)