appendItemValue (NotesDocument - JavaScript)

Creates a new item in a document and optionally sets the item value.

Defined in

NotesDocument

Syntax

appendItemValue(name:string) : NotesItem

appendItemValue(name:string, value:int) : NotesItem

appendItemValue(name:string, value:double) : NotesItem

appendItemValue(name:string, value:Object) : NotesItem

Parameter Description
name The name of the new item.
value The value of the new item.
The data type of the item depends on the data type of the value as follows:
Data type of value Resulting Item
string Text
int Number
double Number
NotesDateTime Date-time item
java.util.Vector with string, int, double, or NotesDateTime elements Multi-value text, number, or date-time item
NotesItem Same data type as the NotesItem
Return value Description
NotesItem The new item.

Usage

Call save after appending the item or the update is lost.

If the document has an item with the same name, this method does not replace it. It creates another item of the same name and gives it the value you specify.

Examples

This button creates a new document in the current database and appends an item named Subject with the value of a requestScope variable. The requestScope variable is bound to an edit box that the user fills in before clicking the button.
var doc = database.createDocument();
doc.appendItemValue("Subject", requestScope.subject);
doc.save()