Notify with my agent will not work perfect!

HiI use this to mail everyone who has the db open. It’s look if there are any new memo, if there is a new memo the mail sends.

Problem is that if there are say 3 new memos it’s send 3 copys of the mail.

Is there anyway to just send one reminder to each person each time.

Kind regards

David

server := “”;

database := “”;

view := “(CheckActiveUser)”;

key := “Active”;

columnNumber := 2;

Choise := @DbLookup( “Notes” : “NoCache” ; server : database ; view ; key ; columnNumber);

sendTo:= @If(@IsError(Choise);“”;@Trim(@Unique(Choise)));

copyTo:=“”;

blindCopyTo:=“”;

subject:=@GetProfileField( “KeyWords”; “NotifySubject” );

remark:=“”;

bodyFields:=@GetProfileField( “KeyWords”; “NotifyMessage” );

@If(form=“Memo” & Mother!=“Child” & Status=“1”;@Do(

@MailSend( sendTo ; copyTo ; blindCopyTo ; subject ; remark ; bodyFields));“”);

SELECT @All

Subject: RE: Notify with my agent will not work perfect!

When you write a macro agent to execute on “new and modified documents,” it will execute once for each document. Since your agent does the same thing each time it’s run, it will send out as many identical messages as there are documents.

If you write a LotusScript or Java agent instead, it will execute once every time new documents are discovered. It’s up to you to decide whether to loop through the documents in the UnprocessedDocuments collection.