Once a month agent

Hi,

I have the following agent. It must be a reminder that runs once a month. It should run on the 25th of each month.

AGENT

tday:=@Date(@Today);

mnth:=@Month(tday);

yr:=@Year(tday);

test:=@TextToTime(@Text(mnth)+“/25/”+@Text(yr));

wkday:=@Weekday(test);

ntest:=@If(wkday=7;@Adjust(test;0;0;-1;0;0;0);wkday=1;@Adjust(test;0;0;-2;0;0;0);test);

@If(tday!=ntest;@Return(“”);@MailSend( “User”; “” ; “” ; “Test” ; “Test” ; “” ; “”))

END

How can I get this to run as a scheduled agent. It shouldn’t run off any documents, it should just run on a daily schedule on its own. However, when I create a scheduled agent, it only has 2 Target options: 1)All docs in db 2)New and modified docs in db.

Any ideas?

Thanx

Subject: Once a month agent

Use “all documents” and ignore the selection.

Subject: Once a month agent

It is always a little hard to be sure what a formula agent is going to do when it runs… formula is a just a little odd… consider rewriting it in Lotusscript, a very simple job, so neither you nor anyone else has to thing about this again.

dim ds as notessession

dim db as notesdatabase

dim memo as notesdocument

if Date(Now) = 25 then

set s = new notessession

set db = s.currentdatabase

set memo = db.createdocument

with memo

 call .replaceitemvalue("Form","Memo")

call .replaceitemvalue("Subject","A subject")

call .replaceitemvalue("Body", "A text value")

call .send(false, "Joe smith")

end with

end if

To create a rich text body, in case you need to append doclinks or something:

dim ds as notessession

dim db as notesdatabase

dim memo as notesdocument

dim body as notesrichtextitem

if Date(Now) = 25 then

set s = new notessession

set db = s.currentdatabase

set memo = db.createdocument

with memo

 call .replaceitemvalue("Form","Memo")

call .replaceitemvalue("Subject","A subject")

set body = .createrichtextitem("Body")

call body.appendtext("A text value.")

call .send(false, "Joe smith")

end with

end if

Subject: Once a month agent

As written I don’t see anything that would cause this agent to modify documents. Stick it in a database that has no documents to be sure, but it looks fine.