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



  • Favorite iSeries cheat sheets

    Here you'll find a collection of valuable cheat sheets gathered from across the iSeries/ community. These cheat ...

  • HTML cheat sheet

    This is a really cool cheat sheet if you're looking to learn more about HTML. You'll find just about everything you every wanted ...

  • Carol Woodbury: Security

    Carol Woodbury