Examples: IsIncludeAgents property (NotesReplicationEntry - LotusScript®)

This agent toggles whether agents are included in replications.

Sub Initialize
  REM Get local database
  dbName$ = "Footoo"
  Dim db As New NotesDatabase("", dbName$)
  Dim rep As NotesReplication
  Dim re As NotesReplicationEntry
  If Not db.IsOpen Then
    Messagebox "No local database",, dbName$
    Exit Sub
  End If
  REM Get source and destination computers
  source$ = "-"
  destination$ = "-"
  REM Get replication entry
  Set rep = db.ReplicationInfo
  Set re = rep.GetEntry(source$, destination$, False)
  If re Is Nothing Then
    Messagebox _
    "No replication entry for " & source$ & _
    " and " & destination$,, _
    "No such replication entry"
    Exit Sub
  End If
  REM Toggle property and save entry
  If re.IsIncludeAgents Then
    re.IsIncludeAgents = False
    re.IsIncludeAgents = True
  End If
  Call re.Save()
  Messagebox "Is now " & re.IsIncludeAgents,, "IsIncludeAgents"
End Sub