getPrevEntity (NotesMIMEEntity - JavaScript)

Returns the MIME entity immediately preceding the current MIME entity within a multipart entity.

Defined in

NotesMIMEEntity

Syntax

getPrevEntity() : NotesMIMEEntity

getPrevEntity(search:int) : NotesMIMEEntity

Parameter Description
search
  • NotesMIMEEntity.SEARCH_DEPTH (1724) (default) searches for child entities first then siblings.
  • NotesMIMEEntity.SEARCH_BREADTH (1723) searches for siblings first then child entries.
Return value Description
NotesMIMEEntity The previous MIME entity, or null.

Examples

This button gets all the entities from the end of the last branch of a multipart entity in reverse order.
// Do not automatically convert MIME to rich text
session.setConvertMIME(false);
var mime:NotesMIMEEntity = currentDocument.getDocument().getMIMEEntity();
if (mime != null) {
	// Drill down to last child at bottom of first branch
	var child:NotesMIMEEntity = mime.getNextEntity(NotesMIMEEntity.SEARCH_BREADTH);
	while (child != null) {
		mime = child;
		child = mime.getNextEntity(NotesMIMEEntity.SEARCH_BREADTH);
	}
	// Get content of all children at bottom level
	// of first branch in reverse order
	while (mime != null) {
		requestScope.status += mime.getContentAsText() + "\n";
		mime = mime.getPrevEntity(NotesMIMEEntity.SEARCH_BREADTH);
	}
} else {
	requestScope.status = "Not MIME";
}
// Restore conversion
session.setConvertMIME(true);