GetPrevSibling (NotesView - LotusScript®)

Given a document in a view, returns the document immediately preceding the given document at the same level. If you send the method a main document, the preceding main document in the view is returned. If you send a response document, the preceding response document with the same parent is returned.

If the view is categorized, the previous sibling must be in the same category as the original document.

Defined in

NotesView

Syntax

Set notesDocument = notesView .GetPrevSibling( document )

Parameters

document

A NotesDocument. Any document in the view. If you specify Nothing, this method generates an error.

Return value

notesDocument

A NotesDocument. The document preceding the specified document, at the same level. Returns Nothing if there is no previous sibling in the view.

Usage

You can use GetPrevSibling to move from one main document to the next, skipping any response documents in between.

If you have filtered the view using FTSearch, GetPrevSibling returns the previous document in the view, regardless of level.

Siblings

Two documents are siblings if:

  • They are both main documents, or
  • They are both responses or response-to-responses and they share the same parent document

The first sibling

GetPrevSibling returns Nothing when the notesDocument parameter is:

  • The first main document in a view
  • The first main document in a particular category of a view
  • The first response (or response-to-response) to a particular parent

Example