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
source.Editmode=True
Call source.refresh
Else
source.Editmode=False
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)
Else
Continue=False
End If
End Sub

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

If source.EditMode Then
Set doc=source.Document
doc.Access=""
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

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com'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 ...

SearchDataCenter

SearchContentManagement

Close