Solved

Enable and disable agent based on date in Lotus notes

Posted on 2007-12-03
11
1,225 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

919 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