Examples: NumActions property (NotesLog - LotusScript®)

  1. This script gets the number of actions logged and places it into the variable count. Here, NumActions returns 2.
    Dim currentLog As New NotesLog( "Database log" )
    Dim count As Integer
    Call currentLog.OpenNotesLog( "", "agentlog.nsf" )
    Call currentLog.LogAction( "This is action number one" )
    Call currentLog.LogAction( "This is action number two" )
    count = currentLog.NumActions
  2. This agent script logs actions and errors to a database, and sends an e-mail memo to the agent's owner letting her know how many actions the script logged. For example, if Susanna Tallan owns the Thread Agent and it logs five actions, the script sends a mail memo to Susanna with "Thread Agent logged 5 actions" in the Subject.
    Sub Initialize
      Dim session As New NotesSession
      Dim agent As NotesAgent
      Dim db As NotesDatabase
      Dim doc As NotesDocument
      Set agent = session.CurrentAgent
      Set db = session.CurrentDatabase
      Dim currentLog As New NotesLog _
      ( "Log for " & agent.Name )
      Call currentLog.OpenNotesLog( "", "agentlog.nsf" )
      '...log some actions and errors...
      Set doc = New NotesDocument( db )
      doc.Form = "Memo"
      doc.Subject = agent.Name & " logged " & _
      currentLog.NumActions & " actions"
      Call doc.Send( False, agent.Owner )
    End Sub