getAttachmentList (NotesXspDocument - JavaScript)

Gets the attachments in the document.

Syntax

getAttachmentList(fieldName:string) : java.util.List
Parameter Description
fieldName The name of the item containing the attachments.
Return value Description
java.util.List The attachments. Each element is of type NotesEmbeddedObject.

Examples

This onclick event gets the names of any attachments to the document. The variable requestScope.xml is bound to a multiline edit box.
var alist = document1.getAttachmentList("body");
if (alist.isEmpty()) {
	requestScope.alist = "No attachments"
} else {
	var result = alist.length.toString() + " attachments\n";
	var alisti = alist.iterator();
	//	Each element is of type NotesEmbeddedObject
	while (alisti.hasNext()) {
		result = result + alisti.next().getName() + "\n";
	}
	requestScope.alist = result;
}