How to find parent document if given a child document

Suppose a user is saving a response document. what lotus script class can be used to locate the parent document to it and all sibling response cosument?

Thanks.

Subject: how to find parent document if given a child document

every response document has a notes item named $Ref which contains the ID of the parent document. This field can be referenced using the document’s ParentDocumentUNID property. In the QuerySave event of the response you can use the following code to locate the parent along with all the parent’s responses

Dim allResponses As NotesDocumentCollection

Dim parentDoc As NotesDocument

Set parentDoc = db.GetDocumentByUNID( Source.Document.ParentDocumentUNID )

If Not(parentDoc Is Nothing ) Then

Set allResponses = parentDoc.Responses

End If

Hope that helps.

Subject: how to find parent document if given a child document

how to create a function that returns the top-level document in a response thread. http://www-10.lotus.com/ldd/today.nsf/0/5a8e03d3db564ac88525668f00658fe0?OpenDocument