Examples: SilentMode property

The following button script toggles the SilentMode property at the user's direction. The ODBCConnection object must be global to retain its state between invocations of the button.

Uselsx "*LSXODBC"
%INCLUDE "lsconst.lss"
Dim con As ODBCConnection
Sub Postopen(Source As Notesuidocument)
  Set con = New ODBCConnection
End Sub
Sub Click(Source As Button)
  If con.SilentMode Then
    If(Messagebox("Do you want to turn it off", _
    MB_YESNO, "SilentMode is on") = IDYES) Then
      con.SilentMode = False
    End If
  Else
    If(Messagebox("Do you want to turn it on", _
    MB_YESNO, "SilentMode is off") = IDYES) Then
      con.SilentMode = True
    End If
  End If
End Sub