How do I create an agent that only runs every 6 months
25 pts.
0
Q:
How do I create an agent that only runs every 6 months
Hello,

I want to create an agent in the Public Address Book, that checks every person document and if the person has been there for over 6 months it emails them. I don't really want to modify the design of the person document to create a hidden field, as it is the address book. Has anyone any suggestions on how I can do this? I thought about using the creation date, but after the first 6 month period the email would be sent to them every month (you can only set up agents to run each month on schedule).

Thanks,
Sartz
ASKED: Aug 4 2009  3:53 AM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
1220 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
Your agent could reside in a separate database, and could create a small doc for each user in the PAB, including the user name, person doc creation date, and notice mailed flag or date. It could then periodically scan a view of those who haven't been emailed, check dates, and mail as appropriate.

If for some reason the agent must reside in the PAB, it could be done there, but there are a lot more gotchas if you do that - notably having to do with design updates.
Last Answered: Aug 4 2009  4:39 PM GMT by Ledlincoln   1220 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

SlikTool   1220 pts.  |   Aug 5 2009  5:34PM GMT

Your questions says - “how to create an agent to run every 6 months?” Do you mean you want it to run more regularly, but maintain a date for each record and process each every 6 months? Or, an agent that runs say on Jan 1, and then June 1 and that is it?

Mike K.

 

Sartz   25 pts.  |   Aug 10 2009  9:42PM GMT

Thanks Mike, Good question. I really only need it to run on Jan 1 and then June the 1.

 

SlikTool   1220 pts.  |   Aug 12 2009  1:27AM GMT

Of course, I assume the Agent will be in Lotus Script, but doesn’t have to be. Setup the agent to run monthly on the first. At the very beginning of the code add the following, it will determine if it is the 1st month or the 6th month, and if it is, then the agent will run, otherwise the agent will not run.

Obviously you should change the month numbers to suit your actual needs.

Dim cdt as New NotesDateTime(Cstr(Now()))

if Month(cdt.lslocaltime) = 6 or Month(cdt.lslocaltime) = 1 then
‘put nothing but this comment here - the code will run
else
exit sub ‘or you could put end as well, either would work
End If

‘the rest of the agent code goes here and below

Mike K

 

Sartz   25 pts.  |   Aug 12 2009  3:31AM GMT

That’s great! Thanks Mike.

 
0