.
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: GetParentDocument method
1. This script finds the parent of the last document in the By Category view of a discussion database and displays its universal ID.
Sub Click(Source As Button)
Dim db As New NotesDatabase( "Byzantium", "discuss.nsf" )
Dim view As NotesView
Dim doc As NotesDocument
Dim parentDoc As NotesDocument
Set view = db.GetView( "By Category" )
If view Is Nothing Then
Messagebox "View not found"
Exit Sub
End If
Set doc = view.GetLastDocument
If doc Is Nothing Then
Messagebox "Last document not found"
Exit Sub
End If
If doc.IsResponse Then
Set parentDoc = view.GetParentDocument( doc )
If parentDoc Is Nothing Then
Messagebox "Error reading parent document"
Exit Sub
End If
Messagebox parentDoc.UniversalID, , _
"UNID of parent of last document"
Else
Messagebox doc.UniversalID, ,"UNID of last document"
End If
End Sub
2. This function takes a document and returns its ancestor -- that is, the original main document that began a response hierarchy. This is useful for discussion databases in which response-to-response documents often nest many levels deep.
Function getAncestor ( doc As NotesDocument ) _
As NotesDocument
Dim view As NotesView
Set view = doc.ParentView
If Not(Doc Is Nothing) Then
While doc.IsResponse
Set doc = view.GetParentDocument( doc )
Wend
End If
Set getAncestor = doc
End Function
See Also
GetParentDocument method
Feedback on
Help
or
Product Usability
?
Help on Help
All Help Contents
Feedback on
Help
or
Usability
?
Help on Help
All Help Contents