LOTUSSCRIPT/COM/OLE CLASSES


GetDocumentByKey method
Example

Finds a document based on its column values within a view. You create an array of keys, where each key corresponds to a value in a sorted column in the view. The method returns the first document whose column values match each key in the array.

Defined in

NotesView

Syntax

Set notesDocument = notesView.GetDocumentByKey( keyArray [, exactMatch% ] )

Parameters

keyArray


exactMatch%
Return value

notesDocument


Usage

For the GetAllDocumentsByKey method to work, you must have at least one sorted column for each key.

If any columns are formatted with both categories and subcategories in the same column (using the "\\" special character), the method will return the first document whose column values match the keyArray values, after the last matching document which uses both a category and a subcategory in one column.

If this method is used under COM, with a keyArray parameter of an array, it must be defined as an array of type Variant.

This method returns only the first document whose column values match the keys you indicate. To locate all matching documents, use GetAllDocumentsByKey, or use this method followed by a GetNextDocument loop. If you use a GetNextDocument loop, you must explicitly check to make sure the next document is a match.

Matches are not case-sensitive. For example, "Turban" matches "turban." In an exact match, "cat" matches "cat" but does not match "category," while "20" matches "20" but does not match "201." In a partial match, "T" matches "Tim" or "turkey," but does not match "attic," while "cat" matches "catalog" or "category," but does not match "coat" or "bobcat."

To get view entry information about the document, use the GetEntryByKey method. See Locating an entry in a view for information about working with view entries.

Language cross-reference

getDocumentByKey method in Java View class

FileOpenDatabase @command in formula language

Example
See Also