buildCollection (NotesNoteCollection - JavaScript™)
Builds (compiles) the note collection.
Defined in
NotesNoteCollectionSyntax
buildCollection() : void
Usage
You must build the collection before it is usable.The built collection contains the database notes determined
by the current values of SelectionFormula, SinceTime, and
the Select
properties.
Initially SelectionFormula and SinceTime select all notes.
Initially the Select
properties
are all true or all false as determined by createNoteCollection.
You can reset them all true or all false with selectAllNotes.
You
can set the
Select
properties individually or in
groups. The following list arranges the Select
properties
under the selectAll
methods that set them: - Not in a
selectAll
group: - Set by selectAllAdminNotes:
- Set by selectAllDesignElements and selectAllCodeElements:
- Set by selectAllDesignElements and selectAllFormatElements:
- Set by selectAllDesignElements and selectAllIndexElements:
- Set by selectAllDesignElements:
Use LastBuildTime to get the time of the last build.
Examples
This button creates a note collection from the documents in the current database and exports it to a text file as DXL.var stream:NotesStream = session.createStream();
var filename:string = "c:\\dxl\\";
filename = filename + database.getFileName();
filename = filename.substring(0, filename.length() - 3) + "dxl";
if (stream.open(filename)) {
requestScope.status = "Opened " + filename;
stream.truncate();
// Create note collection
var nc:NotesNoteCollection = database.createNoteCollection(false);
nc.setSelectDocuments(true);
nc.buildCollection();
// Export note collection as DXL
var exporter:NotesDxlExporter = session.createDxlExporter();
var output:string = exporter.exportDxl(nc);
stream.writeText(output);
requestScope.status = "Exported note collection as DXL ";
stream.close();
} else {
requestScope.status = "Unable to open " + filename;
}