We have run into an issue where the calendar event is submitted without a time zone from a custom list instead of a calendar list. This causes the appointment to be saved to the users Outlook Calendar with the UTC time zone, instead of the local time zone for the user, or the regional time zone for the site collection. Is this due to being a Custom List instead of a Calendar List?
The workflow is based on the date/time you set when you add a new element. None compute action are made to transform the date/time to the value you want (UTC, local or otherwise).
I don't think so the custom list generates an issue.
François THOMAS This is great! Thank you so much for the detailed write up.
Jacob Bradley - My times weren't saving to Outlook correctly either. I did some log to workflow history actions and it showed this:
- Comment was the start and end dates from the item properties:
start date/time: 7/20/2016 3:00 PM
end date/time: 7/20/2016 4:00 PM
- Comment was the formatted date from the build string action:
DTSTART:20160720T150000Z
DTEND:20160720T160000Z
- Comment was the txtAllDayEvent workflow variable (the text making up the .ics file)
BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VEVENT
STATUS:TENTATIVE
DTSTART:20160720T150000Z
DTEND:20160720T160000Z
SUMMARY;ENCODING=QUOTED-PRINTABLE:another appointment
DESCRIPTION;ENCODING=QUOTED-PRINTABLE:=0D=0A
END:VEVENT
END:VCALENDAR
Everything was being captured correctly and sent to outlook with the correct times, but the appointment in Outlook was off by 5 hours. (I am in Central Time, so that should have been -6 hours, but I think it may have been ignoring daylight savings, too.)
I was able to resolve this by removing the "z" from the format date functions in the build string actions, so it looks like this:
DTSTART:fn-FormatDate({ItemProperty:EventDate},"yyyyMMddTHHmmss")
DTEND:fn-FormatDate({ItemProperty:EndDate},"yyyyMMddTHHmmss")
Hope that helps!
Brian
Excellent job documenting this...a couple enhancements to accommodate for the time zone issues...
- Set a intGMTOffset variable to the number offset for your time zone. (CST = 6)
- I created it as a variable, but I think I'll move it to a farm constant, since when DST changes, it would need updating
- Use the "Calculate Date" action to add the variable above to the "hours" portion of the start & end times for the event.
- Change the references in the textAllDayEvent variable to your new variables instead of the ItemProperty values.
Hello,
This is really useful. However, this creates an appointment where a user can't "accept" or "Reject" a meeting invite. Is there a way to create an .ics file that has meeting invite format?
Wow this is great feature
I wonder if there is a workflow also to cancle / remove / delete the appointment from the calendar in outlook?
Seems like; it will be the same workflow but at very end of the Build String, to use the following:
BEGIN:VCALENDAR
VERSION:2.0
METHOD:CANCEL
STATUS:CANCELLED
BEGIN:VEVENT
{WorkflowVariable:txtFreeBusy}
{WorkflowVariable:txtAllDayEvent}
{WorkflowVariable:txtSummary}
{WorkflowVariable:txtLocation}
END:VEVENT
END:VCALENDAR
Although, this does not cancle it but asks you to remove it yourself.
There is no cancellation option...
UPDATE
------------
I thought the above did work but must have mistaken myself ...
Unfortunately, the above does not delete the event from the calendar UNLESS you remove it directly from the calendar manually!
François THOMAS,
How would you add organizer and attendees?
Hi
Is this code any different for Office 2010? We have followed the procedure described but it does not seem to work with Office 2010. Should the Version be 1.0?
These are the errors that appear for Win 10 and Win 7:
operation failed (Win10) and Not a valid Internet calendar file (Win7)
Is there a way to add a reminder alert time in the appointment?