: 4581 | 108544 | 12346

Create empty NotesDocumentCollection  
New idea submissions, commenting and voting are no longer available on this site. Logins have also been disabled.
Use this IdeaSpace to post ideas about Domino Designer.

: 179
: 184
: 5
: Domino Designer
: lotusscript
: Randy Smith3913 30 Oct 2007
: / Email
LotusScript needs a method for creating an empty NotesDocumentCollection object.  Many of us have "silly looking" techniques to create an empty collection anyway.  A sort method for a NotesDocumentCollection would also be nice.

1) Mika Heinonen3551 (30 Oct 2007)
Doesn't "If col is Nothing" do the same?
2) James Summerton1402 (31 Oct 2007)
Correct me if I am wrong, but I think what Randy is getting at is having something like:

set dc = New NotesDocumentCollection(db)

That would give you an empty documentcollection to do things with, instead of having to do a null search or something else that costs extra processing to achieve the same result.
3) Randy Smith3913 (31 Oct 2007)
Exactly James. Without a New method to instantiate an object of this class, we have to be a bit creative (and as a result, less efficient) by using methods of other classes to create the empty collection (bogus search, responses to a bogus profile document, etc.).

If I create subs/functions that take a NotesDocucumentCollection as one of the arguments, I want an easy method for creating an empty collection and then adding the documents that need to be processed by the sub/function to the collection.
4) Keil Wilson110 (08 Nov 2007)
I like the idea of a creating an empty collection. I too have some goofy code for getting an empty collection. But I think the sorting thing is redundant. The ViewEntryCollection already allows you to do this. It is a little more complicated than working with a doc collection, but it's not very difficult to do.
5) Carl Tyler5446 (15 Nov 2007)
I think NotesDocumentCollection.sort should really be called out on it's own, it is a much wanted feature.
6) Scott Cochrane1949 (20 Nov 2007)
Yes, a 'new' method would be nice - and less silly :-)
7) Corey Davis1744 (28 Nov 2007)
I don't think I have ever had the need to create an empty document collection. What would be a reason for needing this?
8) Randy Smith3913 (29 Nov 2007)
@7 - It isn't a technique that I use often, but at times I do have a need to create an empty document collection (for folder processing, workflow processing, etc.). Having an empty collection is not the goal though. The goal is to have total programmatic contol over which documents are included in the collection and not be at the mercy of methods of other classes that are used to create a collection.
9) Peter Presnell26654 (16 Dec 2007)
There must be a lot of us employing the "silly search" technique to get an empty Notesdocumentcollection. If new NotesDocumentCollection is too hard perhaps IBM coluld give use a NotesDatabase.doSillySearch method to simplify the code a little!
10) Marko Bonaci10 (16 Jan 2008)
The reason could be that e.g. you created the function that does some processing on collection of docs and then afterwards you would like to call that function on a few docs that aren't gathered using one collection's init. methods so you have to call profileDoc.Responses in order to create empty collection, but then the profileDoc remains in your db, unless you dereference it and delete it using it's noteID...

It's simply fundamental in OO development.
11) Scott O'Keefe187 (27 Feb 2008)
This is actually available - right now! Try this:

do some dimmin', then

Set yourDocCollection = yourDb.CreateDocumentCollection()

Voila! You've got an empty NotesDocumentCollection. It doesn't appear to be documented, but it is used in the LotusInboxCleanup agent in the mail8.ntf.
12) Frank Strunzkus150 (18 Mar 2009)
Yes please give an option to sort collections ! I'am looking for this since years.
13) Michael Schlömp26 (07 Sep 2009)
I agree. The sorting of a DocumentCollection would be great.
14) Erik Brooks795 (21 Feb 2010)
This feature was delivered (though undocumented) in (I believe) 8.0.2.
15) Bruce Elgort8139 (22 Feb 2010)
Erik and way you can help us ensure that this idea is actually complete?
16) Randy Smith3913 (02 Mar 2010)
The CreateDocumentCollection method of the NotesDatabase class is still not documented in Domino Designer 8.5 Help.
17) Erik Brooks795 (05 Mar 2010)
SPR # DMAT72JLWW Fixed in release: 7.0.4

Product Area: Designer Technical Area: LotusScript Platform: Cross Platform

Lotus Customer Support APAR: LO28240 What is an APAR?

SPR# DMAT72JLWW - Added NotesDatabase.CreateDocumentCollection method to create empty doc collection.

Might be in 8.5.1's documentation, I'd have to check.
18) Bas van Gestel2808 (12 Aug 2010)
Please note that createdocumentcollection still has issues. Using the Subtract and Merge functions fail. That's probabably why it's undocumented.
19) Jim Fricker43 (04 Sep 2012)
My preference is to use...
Set dc = db.GetProfileDocCollection(Chr$(13))
I consider a Carriage Return (CR) (ascii 13) character a very safe (unused) profile name as it is very difficult to create a form name (which is what a profile name is) that only consists of a single CR char. Better in my opinion than profileDoc.Responses as you don't have any profile docs to clean up.


Welcome to IdeaJam™

You can run IdeaJam™ in your company. It's easy to install, setup and customize. Your employees, partners and customers will immediately see results.

Use IdeaJam to:

  • Collect ideas from employees
  • Solicit feedback and suggestions from employees and customers
  • Run innovation contests and competitions
  • Validate concepts
  • Use the power of "crowd-sourcing" to rank ideas and allow the best ideas to rise to the top

IdeaJam™ works with:

  • IBM Connections
  • IBM Lotus Quickr
  • Blogs and Wikis
  • Websphere Portal
  • Microsoft Sharepoint
  • and other applications.

IdeaJam has an extensive set of widgets and API's that allow you to extend and integrate IdeaJam™ with other applications.

Learn more about IdeaJam >>

Add HTTP2 support to Domino

IdeaJam developed by

Elguji Software Logo