Creating Response Doc

I have a database where Doc A is the main document. Doc B is a response to Doc A. Doc C is also a response to Doc A.

I am tasked with creating Doc C from a button on Doc B but it still must remain a response doc to Doc A.

MY PROBLEM:

I am able to create response doc C from response doc B however I do not know how to make it a response doc to Doc A. It of course is always being created as a response to DocB.

Here is my code so far:

Dim ws As New notesuiworkspace

Dim uidoc As notesuidocument



Dim s As New notessession

Dim db As notesdatabase

Dim doc As notesdocument

Dim resp As notesdocument



Set uidoc = ws.currentdocument

Set doc = uidoc.document



Set db = s.currentDatabase

Set resp = db.createDocument

resp.Form = "HDP6"



resp.ECRNumber = doc.ECRNum



Call resp.makeResponse(doc)



'Call resp.save(True, True)

Set uidoc = ws.EditDocument(True, resp)

Thanks for any help in advance.

Teri

Subject: Creating Response Doc

Take a look at the notesdocument class ParentDocumentUNID property which gets the unique id of the parent document.

The following is an example from the notes help

Dim response As NotesDocument

Dim parent As NotesDocument

'…set value of response…

Set parent = db.GetDocumentByUNID(response.ParentDocumentUNID)

and then just make it a response to the parent

Call resp.makeresponse(parent)

Subject: RE: Creating Response Doc

Thanks Matt,

That’s exactly what I needed.

Teri