LotusScript - send Calendar meeting reschedule notice

Posted on 2012-03-22
Last Modified: 2013-12-18
I am sending meeting invitations programatically through LotusScript, from a specific application.
The goal is to send a Calendar invitation to a user by mail.
The user should be able to click action - Add to Calendar, and optimally not have any other options - like Accept / Decline / Propose new time / Delegate, etc...
Although there is a sender, the sender does not need any Calendar entry for himself - this is all about dispatching tasks to others.

I managed to do all of the above, but need one more feature which will make this whole thing useful: when the start or end date and time change, I want to be able to send a reschedule notice to the invitees.
They should be able to open it and - either have it processed automatically into the original Calendar entry, or, have an action button to Add to Calendar.

This is of-course built-in into the Notes C&S design and should be no big deal.
However, for some unknown reason, when I open the reschedule notice - it says that the notice has already been applied to the meeting - and no other option is available.
When you go to the original meeting - there is no update.

I have already tried creating the Notice docs in the sender's mail file and using compute with form, as well as looking at documents created manually and recreating almost every field that I found on the manual docs in the script - which is the version bellow.
I am computing both ApptUNID and $REF fields correctly (they are set to the value of the first Notice's UNID - it only matters that there is the same value everywhere).

To conclude, I need a way to send Calendar entries by mail, plus a way to send updates to those entries.
I am sure that someone else thought about this as well in the history of Notes.
Does anyone have any solution ?

Sub SendNotes(taskdoc As NotesDocument)
	'Send a Calendar Appointment invitiation using Notes style Calendaring and Scheduling built-in the mail template
	Dim invitation As notesdocument
	Dim item As NotesItem
	Dim startdttm As NotesDateTime
	Dim enddttm As NotesDateTime
	Dim rtitem As NotesRichTextItem
	Dim prompt As String
	Dim language As String
	Dim tasktype As String
	Dim tmpItem As NotesItem

	'Compute SendTo and CopyTo items
	Dim SendTo$, CopyTo$

	Set invitation = New NotesDocument( taskdoc.ParentDatabase )
	With invitation
		.ReplaceItemValue "$altPrincipal", taskdoc.Task_assign
		.ReplaceItemValue "$CSVersion", "2"
		.ReplaceItemValue "$EncryptionStatus", "0"
		.ReplaceItemValue "$FromPreferredLanguage", language
		.ReplaceItemValue "$PublicAccess", "1"
		.ReplaceItemValue "$SignatureStatus", "0"
		.ReplaceItemValue "$SMTPKeepNotesItems", "1"
		.ReplaceItemValue "AppointmentType", "3"		
		.ReplaceItemValue "Broadcast", "1"
		.ReplaceItemValue "Chair", TaskDoc.Task_assign
		.ReplaceItemValue "Encrypt", "0"
		.ReplaceItemValue "Form", "Notice"
		Set tmpItem = New NotesItem(invitation, "From", taskdoc.Task_assign, NAMES)
		tmpItem.IsSummary = True		
		.ReplaceItemValue "PreventCounter", "1"
		.ReplaceItemValue "PreventDelegate", "1"
		.ReplaceItemValue "Principal", TaskDoc.Task_assign
		Set tmpItem = New NotesItem(invitation, "SendTo", Split(SendTo$, ","), NAMES)
		tmpItem.IsSummary = True
		Set tmpItem = New NotesItem(invitation, "CopyTo", Split(CopyTo$, ","), NAMES)
		tmpItem.IsSummary = True
		.ReplaceItemValue "SequenceNum", 1
		Set tmpItem = New NotesItem(invitation, "StorageRequiredNames", "1", NAMES)
		tmpItem.IsSummary = True
		.ReplaceItemValue "UpdateSeq", 1
		If taskdoc.ApptUNID(0) = "" Then
		'Send first time invitation
			.ReplaceItemValue "$CSWISL", Evaluate({@Explode("$S:1;$L:1;$B:1;$R:1;$E:1;$W:1;$O:1;$M:1;RequiredAttendees:1;INetRequiredNames:1;AltRequiredNames:1;StorageRequiredNames:1;OptionalAttendees:1;INetOptionalNames:1;AltOptionalNames:1;StorageOptionalNames:1"; ";")})
			.ReplaceItemValue "$HFFlags", "1"
			.ReplaceItemValue "$IconSwitcher", "Meeting"
			.ReplaceItemValue "$NameLanguageTags", language
			.ReplaceItemValue "$StorageCc", ""
			.ReplaceItemValue "$StorageTo", "1"
			.ReplaceItemValue "$TableSwitcher", "FindAvailTimes"
			.ReplaceItemValue "$WatchedItems", Evaluate({@Explode("$S;$L;$B;$R;$E;$W;$O;$M;RequiredAttendees;INetRequiredNames;AltRequiredNames;StorageRequiredNames;OptionalAttendees;INetOptionalNames;AltOptionalNames;StorageOptionalNames"; ";")})
			.ReplaceItemValue "ApptUNID", .UniversalID
			.ReplaceItemValue "FromCategories", "AIO - " + tasktype
			.ReplaceItemValue "IsBroadcast", "0"
			.ReplaceItemValue "Logo", "StdNotesLtr25"
			.ReplaceItemValue "NoticeType", "I"
			.ReplaceItemValue "OrgTable", "C0"
			.ReplaceItemValue "SchedulerSwitcher", "1"
			.ReplaceItemValue "Sign", ""
			.ReplaceItemValue "Subject", ShF_getPhrase("S$Shared", "Task notice") + " - " + taskdoc.Task_name(0)
			.ReplaceItemValue "_ViewIcon", 133
		'Send notice update
			.ReplaceItemValue "$CSFlags", "w"
			.ReplaceItemValue "$CSWISL", Evaluate({@Explode("$L:1;$R:1;$E:1;$W:1;$O:1;$M:1;RequiredAttendees:1;INetRequiredNames:1;AltRequiredNames:1;StorageRequiredNames:1;OptionalAttendees:1;INetOptionalNames:1;AltOptionalNames:1;StorageOptionalNames:1;$S:2;$B:2"; ";")})
			Call .MakeResponse(taskdoc) '(invitation.ParentDatabase.GetProfileDocument("(CalendarProfile)"))
			Set tmpItem = .getfirstitem("$REF")
			Forall v In tmpItem.Values
				v = taskdoc.ApptUNID(0)
			End Forall
			.ReplaceItemValue "$REFOPTIONS", "1"
			.ReplaceItemValue "ApptUNID", taskdoc.ApptUNID
			.ReplaceItemValue "NoticeType", "U"			
			Set tmpItem = New NotesItem(invitation, "RequiredAttendees", Split(SendTo$, ","), NAMES)
			tmpItem.IsSummary = True
			.ReplaceItemValue "Subject", ShF_getPhrase("S$Shared", "Task update") + " - " + taskdoc.Task_name(0)
			.ReplaceItemValue "_ViewIcon", 33
		End If
	End With
	'Set the Body RT field
	Set rtitem = New NotesRichTextItem(invitation, "Body" )
	With rtItem
	End With
	'Compute the Date and time fields
	Set startdttm = New NotesDateTime(Trim(taskdoc.Task_start(0) & " " & taskdoc.Task_Start_Time(0)))
	Set enddttm = New NotesDateTime(Trim(taskdoc.Task_term(0) & " " & taskdoc.Task_term_Time(0)))
	Set invitation.StartDateTime = startdttm '.LocalTime
	invitation.StartDate = taskdoc.Task_start 'startdttm '.LocalTime
	invitation.StartTime = taskdoc.Task_Start_Time 'startdttm '.LocalTime
	invitation.StartTimeZone = Evaluate({@GetCurrentTimeZone})
	Set invitation.EndDateTime = enddttm '.LocalTime
	invitation.EndDate = taskdoc.Task_term 'enddttm '.LocalTime
	invitation.EndTime = taskdoc.Task_term_Time 'enddttm '.LocalTime
	invitation.EndTimeZone = Evaluate({@GetCurrentTimeZone})
	'Send the invitation and save ApptUNID on the task doc
	If taskdoc.ApptUNID(0) = "" Then
		TaskDoc.ApptUNID = invitation.UniversalID
		Call TaskDoc.Save(True, False)
	End If
End Sub

Open in new window

Question by:cohalex
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
  • 3
  • 2
LVL 46

Accepted Solution

Sjef Bosman earned 500 total points
ID: 37756046
Have just 2 cents to offer: use the iCalendar format, see and . Whether and how Notes processes reschedule requests arriving in this format I don't know.

Author Comment

ID: 37756233
We already have a completely different MIME iCal version of this function, designed to send invitations for non-Notes mail users. It was developed a while back, and for some forgotten reason, the updates weren't working in that case also - it was tested with Mac's Entourage mail client.
We didnt test it on Notes, as we figured we could built a native Notes function, to have more control, for the Notes users.
As I don't have other options now, I'll give it a try, but I fear that I will hit the same wall that my colleague who developed the iCal did as well.
LVL 46

Expert Comment

by:Sjef Bosman
ID: 37756405
I hope not, since your colleague developed this more than umpteen years ago... ;-) And Notes has progressed, so...

Fingers crossed!

Author Comment

ID: 37845776
I did manage to make it work with iCal, but there are a couple of disadvantages:
- I am embedding a notes:// link in the HTML body, which doesn't show the alias, just the raw url
- the whole iCal is added by Domino as an attachment in the Body field; users tend to open it, and wonder what to do with it; I guess adding another comment about in the Description would help..

One advantage of this approach is that I only have to maintain one set of functions for all mail clients.

Author Closing Comment

ID: 37845777
workaround suggested - works, but with a compromise in the functionality

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

636 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