getNextNoteID (NotesNoteCollection - JavaScript)

Given a note, finds the note immediately following it in a collection.

Defined in

NotesNoteCollection

Syntax

getNextNoteID(noteid:string) : string
Parameter Description
noteid A valid note ID.
Return value Description
string The ID of the note following the specified note.

Usage

If no next note exists, this method returns a string of length 0.

This method throws an exception if the parameter is an invalid note ID.

Examples

This button builds a note collection of documents from the current database. It removes any document with a subject containing the text "example" then exports the revised collection as DXL.
// Open DXL file
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();
	
	// Remove note if it contains word example
	var id:string = nc.getFirstNoteID();
	while (id.length() > 0) {
		var tmpid = nc.getNextNoteID(id);
		var doc:NotesDocument = database.getDocumentByID(id);
		var  subject:string = doc.getItemValueString("Subject");
		if (subject.toLowerCase().indexOf("example") >= 0) {
			nc.remove(id);
		}
		id = tmpid;
	}

	// Export note collection as DXL
	var exporter:NotesDxlExporter = session.createDxlExporter();
	var output:string = exporter.exportDxl(nc);
	stream.writeText(output);
	stream.close();
	requestScope.status = requestScope.status + "\n" + nc.getCount() +
		" notes written to " + filename;
} else {
	requestScope.status = "Cannot open " + filename;
}