A common scenario is to use LotusScript code to open a Lotus Notes document, access a related response document within it, edit that, and then save it. While this seems straightforward, replication issues can occur if this process is not executed properly.
To avoid replication problems, the modified value in the Lotus Notes response document must be passed back to the parent document. This LotusScript code will help you successfully edit response documents in Lotus Notes without creating replication conflicts.
Dim session As New NotesSession
Dim workspace As New NotesUIWorkspace
Dim db As NotesDatabase
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Dim parentDoc As NotesDocument
Dim view As NotesView
Set db=session.currentDatabase
Set uidoc=workspace.CurrentDocument
Set doc=uidoc.Document
Set view = db.GetView("svLookByDoc")
Set parentDoc = view.GetDocumentByKey
(doc.nJobNo_D(0),True)
If Not (parentDoc Is Nothing )Then
parentDoc.cStatus=doc.actStatus(0)
Call parentDoc.Save(True,False)
parentDoc.CloseMIMEEntities(True)
End If
Do you have comments on this tip? Let us know.
This tip was submitted to the SearchDomino.com tip library by member Ahmad Kamali. 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.