Manage Learn to apply best practices and optimize your operations.

How To Lock And Unlock A Document

After this the Document can only be opened by on person at a time have fun.
First make a Access Field in your Form then make a Script Libary and then add
the Codes in the Script Libary.

Sub CheckInOutPostopen(Source As Notesuidocument)

If source.IsNewDoc Then
Call source.refresh
End If

End Sub

Sub CheckInOutQuerymodechange(Source As Notesuidocument, Continue As Variant)
Dim session As New NotesSession
Dim doc As NotesDocument
Dim un As New NotesName(session.UserName)

Set doc=Source.Document

If doc.Access(0)="" Then
doc.Access=un.Common+ " since "+Cstr(Now)
Call doc.Save(True,True)
Print "Locked "+doc.Access(0)
End If
End Sub

Sub CheckInOutQueryclose(Source As Notesuidocument, Continue As Variant)
Dim doc As NotesDocument

If source.EditMode Then
Set doc=source.Document
Call doc.Save(True,True)
Print "Unlocked"
End If

End Sub
Then in the Form
Sub Postopen(Source As Notesuidocument)
Call CheckInOutPostOpen(Source)
End Sub

Sub Querymodechange(Source As Notesuidocument, Continue As Variant)
Call CheckInOutQueryModeChange(Source, Continue)
End Sub

Sub Queryclose(Source As Notesuidocument, Continue As Variant)
Call CheckInOutQueryClose(Source, Continue)
End Sub

Dig Deeper on Domino Resources



  • iSeries tutorials's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...