removeAllAttachments (NotesXspDocument - JavaScript)

Removes all attachments from a document item.

Syntax

removeAllAttachments(fieldName:string) : void
Parameter Description
fieldName The name of the item containing the attachments.

Usage

You must save (NotesXspDocument - JavaScript) the document for the change to take effect in the data store.

Examples

This button onclick event removes all attachments from the body item if there are any.
if (document1.getAttachmentList("body").isEmpty()) {
	requestScope.alist = "No attachments in body";
} else {
	document1.removeAllAttachments("body");
	requestScope.alist = "All attachments removed from body";
}