Solved

Enable and disable agent based on date in Lotus notes

Posted on 2007-12-03
11
1,231 Views
Last Modified: 2013-12-18
Using Lotus Notes 6.5.2 on Windows XP. I need to use the Out of Office "OOO" agent once a week, but I can't seem to figure out how to enable it on Fridays and disable it on Mondays automatically. This pseudo code shows what I would like to do:

Check date and time
      When day of date is Friday and time is 2:00AM
             Enable OOO
      When day of date is Monday and time is 2:00AM
             Disable OOO
End

As an alternative, I could write a simple agent (Friday_away) that would run on Friday at 2:00AM and reply to all messages that I will be away until Monday. Again, I don't see a way to run another simple agent on Monday (Monday_back) at 2:00AM that will disable the Friday_away agent.

Thanks for your help.
0
Comment
Question by:jkasavan
  • 6
  • 5
11 Comments
 
LVL 31

Expert Comment

by:qwaletee
ID: 20397585
Problem is that four things occur to make OOO work:

1) Agent is enabled/disabled manually through the OOO profile
1a) When agent is enabled, it aborts if it is not yet the start date
1b) When agent is enabled, it only sends a reminder message to you if the end date is past

2) When the agent runs during the active range (1a and 1b did not iccur), it takes MATCHING messages and "rpelies" to them.  Matching messages are those that it has not responded to yet AND THAT FALL IN THE CORFRECT DATE RANGE

So, there are three ways to write your enable/disable code:
a) Replace (1)'s manual process with an automatgic process -- but that would not affect the dates used in 1b, 1c, or 2, sol you'd have to fix the dates in the OOO profile automatically
b) Automatically update the OOO profile -- but then the ganet would always be needlessly active (not such a big deal), and you would have to make sure that it can process based on 2:00 AM instead of midnight
c) Don't use teh native OOO. Instead, write a dumbed-down version that does a simple reply, but your Notes engineering team will have to give you the authority to deploy this alternative version to their server

I would go with #3, if your IT will allow it. The agent is fairly trivial, if you don't need anything fancey:


yourName := "J. Kasavan";
yourMessage := "I am out of the office Friday-Sunday, I'll get back to you when I'm in."
SELECT (@Weekday(DeliveredDate) = 1:7) | (@Weekday(DeliveredDate) = 6 & @Hour(DeliveredDate) > 2) | (@Weekday(DeliveredDate) = 2 & @Hour(DeliveredDate) < 2)
notify := @If(ReplyTo <> ""; replyTo; Principal <> ""; Principal; From = ""; @Return(IMPOSSIBLE); From);
@MailSend(Notify; ""; ""; yourName + " is out of the office ... Re: " + Subject"; yourMessage);

Open in new window

0
 
LVL 2

Author Comment

by:jkasavan
ID: 20403555
I am not sure where I type in those commands in the agent.
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 20408966
Create->Agent

A design panel and properties box will pop up. Give the agent a name, change the run parameters from "action menu" to "after new mail." Change the type of agnet from SIMPLE ACTIONS to FORMULA, then paste the agent code I gave you into the design pane.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Author Comment

by:jkasavan
ID: 20411101
Do I include the line numbers? The pasted code has the numbers separated from the rest of the code:

1:
2:
3:
4:
5:
 yourName := "J. Kasavan";
yourMessage := "I am out of the office Friday-Sunday, I'll get back to you when I'm in."
SELECT (@Weekday(DeliveredDate) = 1:7) | (@Weekday(DeliveredDate) = 6 & @Hour(DeliveredDate) > 2) | (@Weekday(DeliveredDate) = 2 & @Hour(DeliveredDate) < 2)
notify := @If(ReplyTo <> ""; replyTo; Principal <> ""; Principal; From = ""; @Return(IMPOSSIBLE); From);
@MailSend(Notify; ""; ""; yourName + " is out of the office ... Re: " + Subject"; yourMessage);
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 20411168
Take out the line numbers
0
 
LVL 2

Author Comment

by:jkasavan
ID: 20414146
Getting this cryptic (to me) error when trying to save:

@Function or operator expected, or @Function does not require an argument: ')'
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 20414739
My bad. Three typos. Two missing semi-colons, and one extra double-quote. Here's the corrected code:

yourName := "J. Kasavan";
yourMessage := "I am out of the office Friday-Sunday, I'll get back to you when I'm in.";
SELECT (@Weekday(DeliveredDate) = 1:7) | (@Weekday(DeliveredDate) = 6 & @Hour(DeliveredDate) > 2) | (@Weekday(DeliveredDate) = 2 & @Hour(DeliveredDate) < 2);
notify := @If(ReplyTo <> ""; replyTo; Principal <> ""; Principal; From = ""; @Return(IMPOSSIBLE); From);
@MailSend(Notify; ""; ""; yourName + " is out of the office ... Re: " + Subject; yourMessage);
0
 
LVL 2

Author Comment

by:jkasavan
ID: 20431150
Is there a "debug" process for this? Today (Friday) I sent myself some test emails and no reply back from Notes. Then I enabled he OOO tool and I did get an OOO message from that.

Do I still have to request Notes Admin to allow this agent to execute on the server? What exactly would I need to ask them?
0
 
LVL 31

Accepted Solution

by:
qwaletee earned 250 total points
ID: 20446644
You probably did not have rights. You could test it by setting it to run locally, and keeping your nOtes workstation open with the "run local agents" option enabled.

Your admin would have to give your ID permission to run agents on the server, and also have the standard agent settings run (which it probably does have if OOO is working).
0
 
LVL 2

Author Comment

by:jkasavan
ID: 20473776
Yay - it's working. Solution accepted.
0
 
LVL 2

Author Closing Comment

by:jkasavan
ID: 31412351
Thanks much for your help.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Lotus Domino - populate document fields from contents of an inbound email 3 179
External emails not coming through 3 133
Lotus Notes Calendar Issue 5 115
IBM Lotus notes 9 103
For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question