Examples: Remove method (NotesReplicationEntry - LotusScript®)

This agent removes a replication entry.

Sub Initialize
  REM Get local database
  dbName$ = Inputbox$("Database name", _
  "Enter name of local database")
  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
  REM Remove if it exists
  Set rep = db.ReplicationInfo
  Set re = rep.GetEntry(source$, destination$, False)
  If re Is Nothing Then
    Messagebox "Any-to-any does not exist",, _
    "Entry does not exist"
  Else
    Call re.Remove
    Messagebox "Any-to-any entry deleted",, _
    "Entry deleted"
  End If
End Sub