remove (Document - Java)

Permanently removes a document from a database, but does a soft deletion if soft deletions are enabled.

Defined in



public boolean remove(boolean force)
    throws NotesException


boolean force

If true, the document is removed even if another user modifies the document after your program opens it. If false, the document is not removed if another user modifies it.

Return value

  • true if the document is successfully removed
  • false if the document is not deleted because another user modified it and the force parameter is set to false


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

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

You cannot use the remove method on a Document object returned by getDocumentContext.