?
Solved

Enable and disable agent based on date in Lotus notes

Posted on 2007-12-03
11
Medium Priority
?
1,241 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
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!

 
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 1000 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

719 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