Jump to content

Logo

* * * * - 1 votes

Solved : Bank holiday reminder


5 replies to this topic

#1 Silverdollar

    Senior Member

  • Members
  • PipPipPip
  • 91 posts

Posted 05 January 2010 - 01:22 PM

Is it possible to create a rule so that a UPROC runs 2 (or 3 days) before a bank holiday?

Need to send an email reminder just before a bank holiday so that staff remember to do something.

Fairly easy to set up a UPROC to send an email the tricky bit is the scheduling. Can create a rule so that the UPROC only runs on bank holidays (Mon- Fri), however this is not much use as a reminder as it is too late.

What is needed is for the UPROC to run say 2 (or 3) working days before the bank holiday.

This can be done with a script testing the days in advance to their type and sending an email if 2 days in advance is a bank holiday, but this seems a little heavy handed. Is there a way to do this using rules?

$U version 5.2.3

Current rule is
Period 1 days
Position 1 Calender, Beginning

Working Closed Holiday
Mon N N Y
Tue N N Y
Wed N N Y
Thu N N Y
Fri N N Y
Sat N N N
Sun N N N

Offset None

#2 ary

    Hero Member

  • Members
  • PipPipPipPip
  • 179 posts
  • Gender:Male
  • Location:France

Posted 05 January 2010 - 05:42 PM

Hi,

The only solution I can suggest if you want to avoid scripting would be to create a specific calendar for those tasks, where the Holidays would be set manually 2 or 3 days before they occur.

For example, Christmas would be set as a Holiday on Dec. 23rd, and you would schedule your tasks "Every Holiday" using this particular calendar.

Regards,
A.

Edited by ary, 05 January 2010 - 05:45 PM.


#3 kenny

    Hero Member

  • Root Admin
  • PipPipPipPip
  • 270 posts
  • Gender:Male
  • Location:Europe

Posted 06 January 2010 - 09:42 AM

Hi,

I would personally favour some scripting as once the solution is set, you don't need to do any updates - except if the rule you are following is to change. Using a calendar is easier but requires creating manually the "fake" bank holidays. So there is a double risk of: 1. Forgetting to set these days at a certain point 2. Making mistakes when setting them.

Kenny

#4 Silverdollar

    Senior Member

  • Members
  • PipPipPip
  • 91 posts

Posted 06 January 2010 - 12:49 PM

Looks like scripting the way forward.

Email calenders can not be as reliable as the PC could be switched off. Pity as this is a good way to exploit the high level of availability that $U provides and being able to offset a rule to calander or working days in advance of an event would be handy, as the UPROCs need only be very simple.

Thanks for the help.

#5 Silverdollar

    Senior Member

  • Members
  • PipPipPip
  • 91 posts

Posted 06 January 2010 - 03:15 PM

This is proving to be tricky as in 5.2.3 anyway there in no way to show holiday dates with the usdat command.

What I mean is the uxdat command can offset working days or calender days but not holidays as these are just calender days with a type 'h'.

For Easter the UPROC can check current date then 3 calander days in advance to see if that day is type holiday. Then need to check to see if the Monday is a holiday but can only do this with a fiddly loop due to the weekend (or closed days which are also seen as calander days in $U). The loop being fiddly as it will also have to allow for Xmas.

Is there a way to display holiday dates in a calender using the usdat command?

If there is the all thats needed is todays date and the next holiday date and a comparison between them can be done in working days.

#6 ejc

    Junior Member

  • Members
  • Pip
  • 26 posts

Posted 06 January 2010 - 05:20 PM

Hi,

What if you try something like the following?

uxdat "mm/dd/yy" "01/06/10" "mm/dd/yy" "+2d" to get the date of day +2 (or +3d for day +3)

Then starting from the result of this command:

uxdat "mm/dd/yy" "01/08/10" "type" and if the result is equal to "h" send the email.

Eric





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users