Skip to main content
    Country/region select      Terms of use
     Home      Products      Services & solutions      Support & downloads      My account     

developerWorks  >  Lotus  >  Forums & community  >  Best Practice Makes Perfect

Best Practice Makes Perfect

A collaboration with Domino developers about how to do it and how to get it right in Domino

From a question in one of the BOFs here, I've learned that the documentation of the LotusScript NotesNoteCollection method (NotesCollection in the Java API) contains a significant error. The help for the BuildCollection method says, "You must build the collection before it is usable." This is wrong. The documentation writers were only imagining one use for the collection -- to search for notes.

But there's another use for a NotesNoteCollection -- as a generic container for notes that you find by some other means, and add to the collection with the Add method. If this is how you're using the object, there's no need to call BuildCollection.

This is a significant difference, because BuildCollection takes time to execute even if you haven't specified any search criteria. Speed things up by deleting the call.

Andre Guirard | 3 February 2011 08:46:05 AM ET | Lotusphere Staff Room | Comments (4)


1) I use it this way in Sessions db
Ben Langhinrichs | 2/3/2011 10:41:14 AM

I hadn't seen the documentation on that, but I use a couple of collections to assemble the information which I use for the Additional Resources tab. You can find the agent in the sessions db with the name: Create AddRes Subforms.

2) how to initialize such a collection?
Benoit Dubuc | 2/3/2011 2:52:07 PM

Hi Andre.

I am using NotesDocumentCollections in a few applications that way: i use them to build a collection of documents I want to work on and the situation makes it impossible to build a collection using FTSearch or any other means. From what I've read somewhere a few years back, you had to initialize the collection by doing a db.ftsearch on a string that wasn't in the db. Is that still the case with 8.5.x? And how about SSJS: do we have to use that trick to initialize a NotesDocumentCollectin as well?



3) Oups
Benoit Dubuc | 2/3/2011 2:54:23 PM

I just saw your post regarding that exact issue!!! But it doesn't say anything about SSJS. I would imagine it's the same code...

Sorry about that :)

4) Using a NotesNoteCollection as a ’manual’ note container
Andre Guirard | 2/4/2011 9:24:51 AM

@Benoit, I haven't looked into it in SSJS specifically, but all these APIs share common subroutines and internal classes, so I have no reason to think it would be different.

 Add a Comment
Comment:  (No HTML - Links will be converted if prefixed http://)
Remember Me?     Cancel

Search this blog 


    About IBM Privacy Contact