removeItem (NotesDocument - JavaScript)

Removes an item from a document.

Defined in

NotesDocument

Syntax

removeItem(name:string) : void
Parameter Description
name The name of the item to remove from the document. If more than one item has the specified name, all items with this name are removed. If there is no item with the specified name, the method does nothing.

Usage

You can achieve the same result with remove in NotesItem.

To keep the changes to the document, you must call save after removing the item.

Examples

This button removes an item from the current document.
var doc:NotesDocument = currentDocument.getDocument();
if (doc.hasItem("quantity")) {
	doc.removeItem("quantity");
	if (doc.save()) {
		requestScope.status = "Quantity item removed";
	} else {
		requestScope.status = "Save failed";
	}
} else {
	requestScope.status = "Document does not have quantity item";
}