removePermanently (NotesDocument - JavaScript)

Permanently deletes a document from a database, doing a hard deletion even if soft deletions are enabled.

Defined in

NotesDocument

Syntax

removePermanently(force:boolean) : boolean
Parameter Description
force If true, the document is deleted even if another user modifies the document after the program opens it. If false, the document is not deleted if another user modifies it.
Return value Description
boolean
  • true if the document is successfully deleted
  • false if the document is not deleted, because another user modified it and the force parameter is set to false

Usage

This method does a hard deletion even if Allow soft deletions is enabled. See remove to do a soft deletion.

A deleted document cannot be used as a basis for navigation in a view or a document collection.

Examples

This button removes all the documents in a folder.
var view:NotesView = database.getView("oldstuff");
var doc:NotesDocument = view.getFirstDocument();
while (doc != null) {
	var subject:string = doc.getItemValueString("Subject");
	doc.removePermanently(true);
	requestScope.status += "\n\"" + subject + "\" removed";
	doc = view.getFirstDocument(); 
}