hasItem (NotesDocument - JavaScript)

Indicates whether an item exists in the document.

Defined in

NotesDocument

Syntax

hasItem(name:string) : boolean
Parameter Description
String name The name of an item.
Return value Description
true if an item with the name exists in the document
false if no item with the name exists in the document

Examples

This button tells the user whether a specified item exists in the current document.
var itemname:string = requestScope.query; // input box
var doc:NotesDocument = currentDocument.getDocument();
if (doc.hasItem(itemname)) {
	requestScope.status = "The current document has an item named " + itemname;
} else {
	requestScope.status = "The current document does not have an item named " + itemname;
}