Manage Learn to apply best practices and optimize your operations.

LotusScript agent automates selective mail file replication

You can use selective replication to replicate sets of documents in a Notes/Domino database. But what if you need to replicate several Notes/Domino databases? Get the steps and LotusScript agent to set a replication formula for multiple mail files.

Selective replication means that you only need to replicate a set of documents within a Notes/Domino database, instead of all of them. To activate selective replication, you can use Documents by selection formula in the Advanced tab of the Replication Settings dialog box. However, manually implementing this feature for several databases can be cumbersome.

This LotusScript agent automates the task using the NotesReplicationEntry class. Following are the steps needed to create the agent and an example showing how an agent was used to set a replication formula for multiple mail files.

Follow these steps to create the LoutsScript agent:

  1. Open the mail template file on the Domino server. You can also use a copy of the mail file template.
  2. Open the template with Domino Designer.
  3. Select Click-> Create -> Design -> Agent.
  4. Enter the Name, Trigger, Schedule and Target for the agent.
  5. Note: Schedule the agent so that it will run after the design of all of the mail files has been converted to the new changes on the mail template file.

  6. Select LotusScript for the Action type.
  7. Select Initialize object and enter the following LotusScript code. This will set a Selective Replication by date, for example, Documents starting from January 1, 2009.

LotusScript to set selective replication formula
(Click on code for enlarged view and script download.)

Signing the Notes/Domino mail template

To sign the agent with the server ID, perform the following steps:

  1. Use the Domino Administrator to open the server.
  2. Go to the Files tab and select Templates only under Show me.
  3. Select the mail template file.
  4. Go to Files -> Sign -> and select Active Server's ID.
  5. On the server console, issue the command:
    Tell adminp process all

This will force AdminP to immediately administer this request.

Once the agent has been created, scheduled and signed on the mail template file, replace the design of the mail files using the convert task:

load convert [mail_folder_name]/  
*  [mail_file_template_name]

After the design conversion task completes, the agent will run on all mail files according to the set agent schedule will set the selective replication formula on all mail files.

Do you have comments on this tip? Let us know.

This tip was submitted to the tip library by member Bruck Sewnet. Please let others know how useful it is via the rating scale below. Do you have a useful Lotus Notes/Domino technical tip or code snippet to share? Submit it to our monthly tip contest and you could win a prize.

Related resources from

Dig Deeper on LotusScript

  • Favorite iSeries cheat sheets

    Here you'll find a collection of valuable cheat sheets gathered from across the iSeries/ community. These cheat ...