Lotus Software logo
IBM Lotus Domino Designer 8.5
  Versions 8.5 and 8.5.1






GetFirstItem method

Given a name, returns the first item of the specified name belonging to the document.

Defined in

NotesDocument

Syntax

Set notesItem = notesDocument.GetFirstItem( name$ )

Parameters

name$

String. The name of the item you want to find.

Return value

notesItem

NotesItem or NotesRichTextItem. The first item with the specified name. Returns Nothing if the document does not contain an item with this name.

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. The value is inaccessible from a NotesDocument object, unless the object is accessed as the Document property of NotesUIDocument, and GetFirstItem returns Nothing. In some cases, you can use LotusScript to access the field value another way. For example, if a document has a DateComposed field that's computed for display with a formula @Created, use the Created property in NotesDocument.

Using this method to get rich text items

You can use this method to get items declared as NotesRichTextItem as well as NotesItem.

Note In earlier releases, you could not get an item declared as NotesRichTextItem. You had to declare it as Variant.

Language cross-reference

getFirstItem method in Java Document class

See examples

Examples: GetFirstItem method
Related topics
Getting an item and its values in LotusScript classes




Library | Support | Terms of use |

Last updated: Monday, October 5, 2009