NotesItem (JavaScript™)
Represents a discrete value or set of values in a document. The client interface displays items in a document through fields on a form. When a field on a form and an item in a document have the same name, the field displays the item (for example, the Subject field displays the Subject item). All items in a document are accessible programmatically, regardless of what form is used to display the document in the user interface.
Creation
To create a new NotesItem object:- To create a new NotesItem object from scratch, use replaceItemValue in Document. The method appendItemValue also creates an item, but creates another item of the same name if the specified item exists. Use replaceItemValue unless your intent is to create another item with the same name (not recommended).
- To create a new NotesItem object from one that already exists, use copyItemToDocument, copyItem in Document, or replaceItemValue in Document.
You must call save on the document if you want the modified document to be saved to disk. The document won't display the new item in the user interface unless there is a field of the same name on the form used to display the document.
Explicitly call setSummary and specify true if you want the value to be displayed in a view or folder.
Access
To access an existing NotesItem object:- To access an item when you know its name, use getFirstItem in Document.
- To access all the items in a document, use getItems in Document.
- To get an item's value, use getItemValue.
- To create a new item or set an item's value, use replaceItemValue.
- To check for the existence of a particular item in a document, use hasItem.
- To delete an item from a document, use removeItem.