例: UnLock method (NotesView - LotusScript®)

次のビューアクションは、「Main View」というビューをロック解除しようとします。有効なユーザーがロック所有者の 1 人である場合、ロック解除は成功します。

Sub Click(Source As Button)
  Dim session As New NotesSession
  Dim db As NotesDatabase
  Set db = session.CurrentDatabase
  
  REM Exit if locking is not enabled
  If Not db.IsDesignLockingEnabled Then
    Print "Design locking not enabled"
    Exit Sub
  End If
  
  REM Get view
  Dim view As NotesView
  Set view = db.GetView("Main View")
  
  REM Unlock view
  REM View is not unlocked if error is raised
  On Error Goto errh
  Call view.UnLock
  Print "View unlocked - " & view.Name
  Exit Sub
errh:
  Print "View NOT unlocked - " & view.Name
  Exit Sub
End Sub