Send Reminder via outlook - outlook

We have a set of processes that need to be performed. Some are done daily, some weekly and some monthly. There is a deadline set up for each process before which it should be completed. We need to send a reminder to the team in the following way.
If the process runs daily and needs to be completed before a particular time, then a reminder should be sent 2 hours before that
If it runs weekly on a particular day then a reminder should be sent at 10AM IST of that particular day
If the process runs monthly and needs to be completed before a particular day, then a reminder should be sent just a day before the end date.
How can I create a VB script for the above task?

The Reminder class doesn't provide any property or method for changing the time. But you may create an appointment item on your calendar for each event (it can be a recurrent item) and set the reminder for the item. The ReminderMinutesBeforeStart property of the AppointmentItem class returns an integer indicating the number of minutes the reminder should occur prior to the start of the appointment. The ReminderSet property allows to set a Boolean value that is True if a reminder has been set for this item. For example:
Sub AddAppointment()
Dim apti As Outlook.AppointmentItem
Set apti = Application.CreateItem(olAppointmentItem)
apti.Subject = "Car Servicing"
apti.Start = DateAdd("n", 16, Now)
apti.End = DateAdd("n", 60, apti.Start)
apti.ReminderSet = True
apti.ReminderMinutesBeforeStart = 60
apti.Save
End Sub

Related

Restrict Function Not Working Properly with Recurring Items

It seems that the Restrict function is not working properly with Calendar items. Specifically, when a filter is passed to return calendar items within a specified time, then recurring meetings are returned do not occur between the times specified in the filter.
Problem can be reproduced as follows:
Calendar = outlook_mapi.GetDefaultFolder(OlDefaultFolders.olFolderCalendar)
all_messages = calendar.Items
all_messages.IncludeRecurrences = True
all_messages = all_messages.Restrict(f"[Start] >= '{date_str} 12:00AM' And [Start] <= '{date_str} 11:59PM'")
where date_str =f"{month}/{day}/{year}" and month/day/year is the particular date that we want to read the calendar
This then returns all recurring meetings in a user's calendar, irrespective of whether they occur on the specified time above or not.

Using ACR Notifications to fire daily at scheduled times

Currently i making a med schedule which fires a local notification everyday at the time your med is due, so far i have got it working for the first day but it will not fire again unless the user clicks on the notification.
else if (Device.RuntimePlatform == Device.iOS)
{
App.BadgeCount = App.BadgeCount + 1;
CrossNotifications.Current.Badge = App.BadgeCount;
Random rnd = new Random();
string stringid = rnd.Next(1, 1000000000).ToString();
stringid = CrossNotifications.Current.Send(usermedid, "Please take " + dosage + " of " + medname, "ding", ms);
Debug.WriteLine("Notification saved" + stringid);
Is there any way to add in my code a way to set the notification to repeat daily at that exact time without having to click on the notification ? Would be best to revert to using UILocalNotifications and using the repeat interval ?
Any help appreciated .. Thanks
From what I can see in the ACR source it can only schedule something through tje calendar, so yes, then you will need a manual action to schedule the next one. Also, I think there is a limit to how many notifications you can schedule in the future.
You are mentioning UILocalNotifications, not that this API is deprecated as of iOS 10. You probably want to use the replacement: UNNotificationRequest. Looking at that API, there is a function to schedule notifications with an interval and the option to let them repeat for each interval. In native code this looks like this:
let trigger = UNTimeIntervalNotificationTrigger(timeInterval: (30*60), repeats: false)
That is probably what you are after. So now you need to either find a plugin that supports this, or write something yourself

Google Calendar API Returning multiple events with similar Event IDs

I am getting events from the Google API through the event feed as follows
Dim EventFeed As EventFeed = mservService.Query(EvtQuery)
Dim EventEntry As EventEntry
For Each EventEntry In EventFeed.Entries
sEventID = EventEntry.EventId
Next
The EvtQuery.Uri = https://www.google.com/calendar/feeds/thisistheprivatecalendarname/private/full?max-results=10000&start-min=2014-01-14T10:14:23-07:00&start-max=2014-02-14T10:14:23-07:00
This seems to work great and is returning all of the events. However, I am also getting some events returned that are NOT on the calendar when I look at it...
Examples as follows...
EVENT ID Event Title Visible on Calendar
o8jji0o7v85gmsihabus2igo78 Joe smith TRUE
p61tspg9or4aovnhmpoc1jh87o_20140115T230000Z Joe smith (every other week) FALSE
8rmipc7ko7rbdrsvuev8al32q4_20140115T211500Z HOLD (monthly) TRUE
8rmipc7ko7rbdrsvuev8al32q4 OPEN (3 of 4 wks) FALSE
These appointments come through as having the same date and time. Why would I be getting appointments that do not show on the calendar?
Thanks!

Determine the amount of clicks required to reach a specific date using a JQuery calendar?

I have a jquery calendar for the start date of a project.
Using Watir (automated browser driver, a gem for ruby), I have a set date that I would like to enter in.
The calendar start date is always today's date, whatever that may be for the day it is used. I was wondering if there was a way that ruby can process what today's date is, and use the specified date provided by the user, to calculate the difference of months between them.
Here is an example of the Calendar plugin: http://jqueryui.com/datepicker/
example:
today's date is 30/10/2012, if there was a project that were to start on the 20/12/2012, that would be 2 months from now, so 2 clicks on the next month button.
Is there a way I could do this?
Here is how I approached a similar situation with JSdatepicker:
$today = Time.now.strftime("%e").gsub(" ", "") #one digit day of month without leading space
#browser.text_field(:id => /dateAvailable/).click
Watir::Wait.until(60) {#browser.div(:id => /dateAvailable_popup_cal/).td(:text => $today).exists?}
#browser.div(:id => /dateAvailable_popup_cal/).td(:text => $today).click
Set or grab the date.
Click the text_field that fires the JSDatePicker object
Wait until the calendar actually pops up
The current month is shown, so choose today's date number.
In your case, you also need to set the month. Whether prompting the user for this, or choosing "today", the theory is the same:
$month = Date::MONTHNAMES[Date.today.month] #etc
Pseudo-code making lots of assumptions (only future dates, month name shown on calendar as text, etc):
while !#jquerytablewindow.text.include?($month)
next_month_button.click
end
I don't see a specific advantage to my method versus counting each month, unless of course we add a month to the calendar one day and you still want your code to work!
You could do:
#End date converted to date object
specified_date = '20/12/2012'
end_date = Date.parse(specified_date)
#Start date (today - 30/10/2012)
today = Date.today
#Determine difference in months
number_of_months_up_to_today = (today.month + today.year * 12)
number_of_months_up_to_end = (end_date.month + end_date.year * 12)
clicks_required = number_of_months_up_to_end - number_of_months_up_to_today
#=> 2
Basically it is counting the number of months since the year 0 and then finding the difference.

How do I dynamically select parameter with crystal report

I have been working on getting a report out for long without success.
I have a report that select based on parameter fields of date and boolean. Currently I have to create 3 reports. One based on dates, one based on the boolean and one based on both.
However, I want my report to be able to select all dates if the user does not input date in the parameter or select all booleans if user does not select one.
Currently I used this
if ({?Start Date} = DateTimeValue('') or {?End Date} =DateTimeValue('')) then
{rectReport.Call date} in DateTimeValue ('1753-01-01 00:00:00') to CurrentDateTime
else
({rectReport.Call date} in {?Start Date} to {?End Date}) and {rectReport.EngineDown} = {?Engine Down}
The basic Idea I am looking for is that the user can decide to select only one parameter instead of the two.
Any help will be highly appreciated.
Thanks,
Bimbo
In Crystal 2008 you have the option of making parameters optional. What you could do is create one report with both parameters and then set both parameters as optional. In your record selection formula you could do something like this:
(if (HasValue({?Startdate}) and HasValue({?Enddate}))
then {table.datefield} in {?Startdate} to {?Enddate}
else {table.datefield} in {defaultstartdate} to {defaultenddate})
and (if HasValue({?BoolParam}) then {table.boolfield} = {?BoolParam}
else {table.boolfield} = {defaultbool})
If you wanted to select ALL tables if the user did not input the parameter, you could just omit the else-statements.
(note: Sorry if that syntax isn't correct (I am just getting back into CR again), but you get the idea.)
EDIT: Since optional parameters aren't available in CR10, couldn't you just use parameter default values for the dates instead? For the boolean, you could just make a parameter with 3 values: true, false, and "all" and then default to the "all" value when running the report.
I don't know your particular situation, but the way we handle this (specifically for Defined Periods vs User-specified-Date-Range) is through being able to set defaults.
Our main environment is BOE XI.
Our parameters might be
ReportPeriod (String Variable)
and
CustomDates (DateTime Range, but will work as two discrete dates)
Example params for ReportPeriod might be
1 Day
7 Days
Last Month
Custom Dates
Formulas are used to calculate date limits that will be used in the record selection. I start with the END DATE, as it is convenient for our period reports.
#EndDate
Select ?ReportPeriod
Case
"1 Day", "7 Days" : CurrentDate
// Conveniently defaults to MIDNIGHT
"Last Month" : Maximum(LastFullMonth)
"CustomDates" : Maximum(?CustomDates)
// Or discrete parameter for end date
default : CurrentDate
#BeginDate
Select ?ReportPeriod
Case
"1 Day" : DateAdd("d", -1, #EndDate)
"7 Days" : DateAdd("d", -7, #EndDate)
"Last Month" : Minimum(LastFullMonth)
"CustomDates" : Minimum(?CustomDates)
// Or discrete parameter for end date
default : DateAdd("d", -1, #EndDate)
And, let me caution against using CurentDateTime unless necessary. Every time you try to step through the report, the selection will have changed: 5:01:10 PM ... 5:01:16 PM ... 5:01:24 PM ...
When publishing a report, we set default date (it doesn't matter what, it's only used for CUSTOM and the customer resets it then), and a default ReportPeriod.
The report can be scheduled periodically (based on ReportPeriod) and it will always run.
If the user wants to do custom dates (historic reporting, etc.), then they can chose that for report period, and then set whatever start and end dates they need.
Helpful?

Resources