Examples: OnBlur event (Field - LotusScript®)

This is the OnBlur event for the "Subject" field of a form. It forces the user to enter a value.

Sub Onblur(Source As Field)
  Dim ws As New NotesUIWorkspace
  Dim uidoc As NotesUIDocument
  Set uidoc = ws.CurrentDocument
  If uidoc.FieldGetText("Subject") = "" Then
    Print "Subject cannot be blank"
    Print "Subject: """ & uidoc.FieldGetText("Subject") & """"
  End If
End Sub