Examples: Trigger property

  1. This script indicates whether or not the current is triggered manually.
    Dim session As New NotesSession
    Dim agent As NotesAgent
    Set agent = session.CurrentAgent
    If agent.Trigger= TRIGGER_MANUAL Then   
      Messagebox "Manual"
    Else
      Messagebox "Not manual"
    End If
  2. This script determines when the current agent runs and displays the result.
    Dim session As New NotesSession
    Dim agent As NotesAgent
    Dim db As NotesDatabase
    Set agent = session.CurrentAgent
    triggerDoc = agent.Trigger
    Select Case triggerDoc
    Case TRIGGER_NONE : triggerDoc = _
    "This agent doesn't have a schedule."
    Case TRIGGER_SCHEDULED : triggerDoc = _
    "This agent runs when it is scheduled."
    Case TRIGGER_AFTER_MAIL_DELIVERY : triggerDoc = _
    "This agent runs after there is new mail."
    Case TRIGGER_MANUAL : triggerDoc = "This agent runs manually."
    Case TRIGGER_DOC_PASTED : triggerDoc = _
    "This agent runs when documents have been pasted."
    Case TRIGGER_DOC_UPDATE : triggerDoc = _
    "This agent runs if documents have been updated."
    Case TRIGGER_BEFORE_MAIL_DELIVERY : triggerDoc = _
    "This agent runs before new mail."
    Case TRIGGER_SERVERSTART : triggerDoc = _
    "This agent runs when the Domino server starts."
    End Select
    Messagebox triggerDoc