Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

LotusScript - send Calendar meeting reschedule notice

Posted on 2012-03-22
5
Medium Priority
?
2,948 Views
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
		Else
		'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
	Invitation.Send(False)
	If taskdoc.ApptUNID(0) = "" Then
		TaskDoc.ApptUNID = invitation.UniversalID
		Call TaskDoc.Save(True, False)
	End If
End Sub

Open in new window

0
Comment
Question by:cohalex
  • 3
  • 2
5 Comments
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 1500 total points
ID: 37756046
Have just 2 cents to offer: use the iCalendar format, see http://en.wikipedia.org/wiki/ICalendar and http://www-10.lotus.com/ldd/dominowiki.nsf/dx/ical-comp-domino-exchange . Whether and how Notes processes reschedule requests arriving in this format I don't know.
0
 
LVL 4

Author Comment

by:cohalex
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.
0
 
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!
0
 
LVL 4

Author Comment

by:cohalex
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.
0
 
LVL 4

Author Closing Comment

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

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise 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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

824 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