.
HCLSoftware Business Partner
Domino Consulting Services
CRUCIAL Notes Tools
+1
212-599-2048
Domino Consulting Services
CRUCIAL Notes Tools
Domino administration
Notes development
Chat now
.
EN - English
CN - 中文
JP - 日本語
DE - Deutsch
FR - Français
BR - Português
RU - Pу́сский
IT - Italiano
IN - हिन्दी
ES - Español
KR - 한국어
ID - Indonesia
NL - Dutch
TR - Türkçe
SA - العربية
SE - Svenska
NO - Norsk
PL - Polski
TH - ไทย
DK - Dansk
MY - Malay
PH - Filipino
GR - Ελληνικά
FI - Suomi
IL - עברית
IE - Gaeilge
CZ - Čeština
UA - Українська
RO - Română
VN - Tiếng Việt
BD - বাংলা
HU - Magyar
Need a Domino Consultant? Call NotesMail +1 212-599-2048
-
HCLSoftware Business Partner
LOTUSSCRIPT/COM/OLE CLASSES
Examples: GetNextSibling method
1. This script gets the second main document in the Main View of a database, skipping over any responses to the first main document.
If the Main View is categorized and firstMainDoc is the only main document in its category, GetNextSibling returns Nothing, even if there are more main documents in other categories in the view.
If the Main View is categorized and firstMainDoc is not the only main document in its category, GetNextSibling returns the next main document in the same category as currentDoc.
If the Main View is not categorized, GetNextSibling returns the next main document.
Dim db As New NotesDatabase( "Providence", "buddy.nsf" )
Dim view As NotesView
Dim firstMainDoc As NotesDocument
Dim secondMainDoc As NotesDocument
Set view = db.GetView( "Main View" )
Set firstMainDoc = view.GetFirstDocument
Set secondMainDoc = view.GetNextSibling( firstMainDoc )
2. The script calculates an item value in a main document based on item values in its response documents. Here, the total item in a main document is calculated to be the sum of all the total items of its responses. The script moves from one main document to the next and from one response document to the next. The Main View is not categorized.
Dim db As New NotesDatabase( "Cape-Town", "richardj.nsf" )
Dim view As NotesView
Dim parentDoc As NotesDocument
Dim responseDoc As NotesDocument
Set view = db.GetView( "Main View" )
Set parentDoc = view.GetFirstDocument
' Visit each main document in the view
While Not ( parentDoc Is Nothing )
newTotal% = 0
Set responseDoc = view.GetChild( parentDoc )
' Visit each of the parent's response documents
While Not ( responseDoc Is Nothing )
subtotal = responseDoc.GetItemValue( "total" )
newTotal% = newTotal% + Cint( subtotal( 0 ) )
Set responseDoc = view.GetNextSibling( responseDoc )
Wend
' Put the new total onto the parent document
Call parentDoc.ReplaceItemValue( "total", newTotal% )
Call parentDoc.Save( True, False )
Set parentDoc = view.GetNextSibling( parentDoc )
Wend
See Also
GetNextSibling method
Feedback on
Help
or
Product Usability
?
Help on Help
All Help Contents
Feedback on
Help
or
Usability
?
Help on Help
All Help Contents