Examples: LastRun property (NotesSession - LotusScript®)

  1. This agent script gets the date that the agent was last run, and puts it into runDate. For example, if the agent last ran on August 15, 1996, at 11:09:20 AM, LastRun returns 8/15/96 11:09:20 AM. If this is the first time that the agent has run, LastRun returns 11/30/1899.
    Sub Initialize
      Dim session As New NotesSession
      Dim runDate As Variant
      runDate = session.LastRun
    End Sub
  2. This agent script checks if the current database's full-text index has been updated since the agent last ran. If not, it updates the index.
    Sub Initialize
      Dim session As New NotesSession
      Dim db As NotesDatabase
      Set db = session.CurrentDatabase
      If ( session.LastRun > db.LastFTIndexed ) Then
        Call db.UpdateFTIndex( False )
      End If
    End Sub