Okay if it needs to be the next month 8. date
Set(NextMonthFirstDay, DateAdd(Today(), 1, TimeUnit.Months) - Day(Today()) + 1);
Set(ReminderDate, DateAdd(NextMonthFirstDay, 7, TimeUnit.Days));
Office365Outlook.V3CalendarPostItem(
LookUp(Office365Outlook.CalendarGetTables().value, DisplayName="Calendar").Name,
"DELETE DRIVER FROM THE SYSTEM",
ReminderDate,
ReminderDate,
{
Importance: "High",
IsAllDay: false,
RequiredAttendees: "nichole.bates@stationtaxis.com; michael.grogan@stationtaxis.com",
Body: "Reminder to delete this driver from the system on the 8th of the following month: " & Upper(FstName.Text) & " , " & Upper('2ndName'.Text) & " , Badge Number:" & Badge2.Text & " " & BadgeDrvr.Text,
IsHtml: true
}
);
if it needs to be the next 8.date.
Set(CurrentDate, Today());
Set(CurrentMonth8th, DateValue(Text(Year(CurrentDate)) & "-" & Text(Month(CurrentDate), "00") & "-08"));
If(
CurrentDate <= CurrentMonth8th,
Set(ReminderDate, CurrentMonth8th),
Set(ReminderDate, DateAdd(CurrentMonth8th, 1, TimeUnit.Months))
);
Office365Outlook.V3CalendarPostItem(
LookUp(Office365Outlook.CalendarGetTables().value, DisplayName="Calendar").Name,
"DELETE DRIVER FROM THE SYSTEM",
ReminderDate,
ReminderDate,
{
Importance: "High",
IsAllDay: false,
RequiredAttendees: "nichole.bates@stationtaxis.com; michael.grogan@stationtaxis.com",
Body: "Reminder to delete this driver from the system on the 8th: " & Upper(FstName.Text) & " , " & Upper('2ndName'.Text) & " , Badge Number:" & Badge2.Text & " " & BadgeDrvr.Text,
IsHtml: true
}
);