save (NotesXspDocument - JavaScript)

Saves the document in the data store.

Syntax

save() : boolean
Return value Description
boolean true if the save is successful; false otherwise.

Usage

Changes to the XSP document are reflected in the client but you must save the document for the changes to take effect in the data store. This includes creating, setting, and removing items.

Examples

This button sets a value for the subject item if it has none, saves the document, and opens the previous page.
if (document1.getItemValueString("subject").trim().length == 0 {
	document1.setValue("subject", "No subject");
}
document1.save();
context.redirectToPrevious();