Solved

Enable and disable agent based on date in Lotus notes

Posted on 2007-12-03
11
1,224 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
 
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
This video discusses moving either the default database or any database to a new volume.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now