Responses (NotesDocument - JavaScript)

Read-only. The immediate responses to a document.

Defined in

NotesDocument

Syntax

getResponses() : NotesDocumentCollection

Usage

Each document returned is an immediate response to the first document. Responses-to-responses are not included. You can write a recursive function to access all descendants.

If the current document has no responses, the collection contains zero documents.

Examples

This button gets all descendants of the current document.
function getResponses(dc:NotesDocumentCollection, tab:string) {
	var response = dc.getFirstDocument();
	while (response != null) {
		requestScope.status += "\n" + tab + response.getItemValueString("subject");
		if (response.getResponses().getCount() > 0) {
			tab = tab + "\t";
			getResponses(response.getResponses(), tab);
			tab = tab.left(tab.length - 1);
		}
		var tmpdoc = dc.getNextDocument();
		response.recycle(); // recycle to avoid memory problems
		response = tmpdoc;
	}
}

try {
	var doc:NotesDocument = currentDocument.getDocument();
	if (doc.getResponses().getCount() > 0) {
		getResponses(doc.getResponses(), "");
	} else {
		requestScope.status = "No response documents";
	}
} catch(e) {
	requestScope.status = "No document selected" + e.toString();
}