Calendar View Sorting

I’m writing some LotusScript to get a calendar entry based on given date and time.

The entry will always be a meeting, so AppointmentType=3

I am using a NotesDocumentCollection in case there is more than 1 meeting at the given time in the users calendar.

However, I seem to get no documents, even though I know there is at least 1 for the given date and time.

I am using the “Calendar” view, which I understand has a sorted first column which, for AppointmentType=3 uses the CalendarDateTime for sorting.

My LS is below (excluding dims):

Reg.RegistrationServer = “myserver”

Set Chair = New notesname(doc.chair(0))

CalDateTime = Doc.CalendarDateTime(0)

Call reg.GetUserInfo(Chair.Abbreviated, mailserver, mailfile, maildomain, mailsystem, profile)



Set userdb = sess.GetDatabase(mailserver, mailfile)



Set view = userdb.GetView("Calendar")

Set DocColl = view.GetAllDocumentsByKey(CalDateTime, True)

Print DocColl.Count

The CalDateTime is taken from a resource reservation form so is in the same format as the CalendarDateTime item in each calendar entry.

Where am I going wrong?

Subject: Calendar View Sorting

My suggestion would be to make a copy of the calendar view and change this copy into a general view format. Now you will see the columns (inluding the hidden ones) and from there it should not be that difficult to spot the problem.

Subject: RE: Calendar View Sorting

Good idea, I’ll give that a try