Solved

query Notes for calendar items today

Posted on 2010-11-29
12
1,415 Views
Last Modified: 2013-12-17
I am using the Lotus Domino and Notes Toolkit for COM via C#.

Currently, I can retrieve a complete list of calendar NotesDocument entries in a NotesView.  From there, I must iterate through the list to find entries for today because recurring calendar events are stored in the first entry created for that entry.  This is so slow.

Is there a way to get a NotesView containing only the calendar events for today using Notes own query engine?
0
Comment
Question by:jlalande
[X]
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
  • 6
  • 6
12 Comments
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 34237153
I'd assume there is a calendar entry for the current day even for recurring events. How else would they be present in the $Calendar view? Or is it only one document with a multi-value field containing multiple dates?

Which view do you use to get the documents, and how do you retrieve them?
0
 

Author Comment

by:jlalande
ID: 34238055
The method to retrieve a view populated with calendar entries is:
  NotesView view = db.GetView("($Meetings)");
where db is the database.

For recurring calendar entry, when created, there is only one entry with a document property named RepeatInstanceDates containing a list of date/times.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 34250336
Try with
  NotesView view = db.GetView("($Calendar)");
0
How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 500 total points
ID: 34250420
Or
  NotesView view = db.GetView("(CalSummary)");

Be careful: this view isn't organised by date values, but by date strings. the first column is
 @Text(@Date(CalendarDateTime))
but you can use it to find out quickly if there are appointments on a specific date (use GetDocumentByKey(datestring, true).

0
 

Author Comment

by:jlalande
ID: 34252125
Using GetDocumentByKey isn't returning a collection containing the recurring meeting.  

Meetings were only returned at all if I used CalSummary, but only the one instance meetings today.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 34257071
What I'd try:
- get all appointments for today using the CalSummary view (GetAllDocumentsByKey("02-12-2010") or a different date text format)
- and for tomorrow, etc.
0
 

Author Comment

by:jlalande
ID: 34259057
With only a recurring appointment today and one tomorrow, getting the appointments today and tomorrow as you describe gives me nothing.

Maybe the COM toolkit won't do this.  Is there another API for Domino/Notes that will?
0
 

Author Comment

by:jlalande
ID: 34658162
In a final effort to get this question put to bed, is there any way to grab a list of calendar entries for meetings on a given day, both one-time meetings and repeating meetings created in the past.

I am using the COM toolkit, but if this is not possible using COM, I can use another.
0
 

Author Comment

by:jlalande
ID: 34974410
This is getting stale, but I think I found an answer.

Using the Search method of the NotesDatabase object, I can call:

db.Search("Form = 'Appointment' & Repeats = '1'");
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 34975045
Thanks!

You could also create a full-text index in your database, so you can do a full-text search. It's only useful if it's a database with a largee number of documents. db.Search is a sequential search, db.FtSearch uses the full-text index. The FTSearch equivalent of your query is
      "Field Form=Appointment & Field Repeates=1"

You could even make both queries more specific, e.g. to get only the items for one day, with additional conditions.
0
 

Author Comment

by:jlalande
ID: 34975254
Hi sjef,

This is the mechanism I am using now where the query string looks like:
            NotesView repeatsView = this.database.GetView("($Meetings)");
            var query = "([Repeats] = 1) and not ([NoticeType] = C) and not ([NoticeType] = R) ";
            query += "and not ([AppointmentType] = 4) and not ([AppointmentType] = 1)";
            int repeatsCount = repeatsView.FTSearch(query, repeatsView.EntryCount);

However, experiments today showed db.Search to be over twice as fast.  Furthermore, the index could be out of date as explained here: http://mattwhite.me/blog/2010/1/1/why-using-ftsearch-in-lotusscript-is-usually-a-bad-idea.html

I do have another open question about finding a date in the field RepeatInstanceDates.  If you have an answer for that, that would make my year.

http://www.experts-exchange.com/Software/Server_Software/Email_Servers/Lotus_Domino/Q_26846326.html
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 34975566
As I said, Search is sequential, and depending on the quality of the server you'll notice that Search is faster up to say 10000 documents. Beyond that, FTSearch wins. If you do this query once per day, or 10 times, or even 100, use db.Search.

Just a question: the database *is* indeed full-text indexed? FTSearch also works on a non-indexed database, but is a lot slower then.

I'll look at the other question tomorrow.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

740 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