JAVA/CORBA CLASSES


getFirstItem method
Example

Returns the first item of a specified name in a document.

Defined in

Document

Syntax

public Item getFirstItem(String name)
   throws NotesException

Parameters

String name


Return value

Item


Usage

If multiple items in a document have the same name, programmatic access is limited to the first item. The remaining items yield invalid data. A work-around is to get the first item, process it, remove it, again get the first item (which was the second item), and so on until you process all the items with the same name. If you do not save the document, the items are not actually removed. However, the recommendation is that you avoid creating multiple items with the same name.

If the value of a field is computed for display, the value is not stored as an item and is inaccessible from a Document object. In some cases, you can access the field value another way. For example, if a document has a DateComposed field computed for display with the formula @Created, use getCreated.

Using this method to get rich text items

To get a rich text item, explicitly cast the return value from getFirstItem to RichTextItem.


Language cross-reference

GetFirstItem method in LotusScript NotesDocument class

Example
See Also