How do I make this a repsonse document?

HiI have the following code (agent) that works well…however I need the doc being created to be a response doc, at the moment, it is being saved as a standard doc…

Sub Initialize

Dim session As New NotesSession

Dim db As NotesDatabase

Dim view As NotesView

Dim ItemA As NotesItem

Dim ItemB As NotesItem

Dim ItemC As NotesItem

Dim ItemD As NotesItem

Dim ItemE As NotesItem

Dim ItemF As NotesItem	

Dim doc As NotesDocument

Dim doc2 As NotesDocument

Dim workspace As New NotesUIWorkspace



Set db = session.CurrentDatabase

Set view = db.GetView( "(CheckMeetingDate)" )

Set doc = view.GetFirstDocument



If doc.IENEventDate(0) < Today Then

	'Set temp = Doc.CFRClient

	'Msgbox "Meeting is late!"

	

	Set doc2 = db.CreateDocument

	Set itemB = doc2.AppendItemValue ("Form",  "CFRF" )	

	Set itemA = doc2.AppendItemValue ("IENCompany", Doc.IENCompany )

	Set itemC = doc2.AppendItemValue ("CFRDateOfMeet", Doc.IENEventDate )

	Set itemD = doc2.AppendItemValue ("IENCompanyDocID", Doc.IENCompanyDocID )

	Set itemE = doc2.AppendItemValue ("IENEventDescription", Doc.IENEventDescription )

	Set itemE = doc2.AppendItemValue ("$Ref", Doc.IENEventDocumentUniqueID )

	

	

	Call doc2.save(True,True)

	

	

	'Call workspace.EditDocument(True, doc)

	

	Set mailDoc = db.CreateDocument

	mailDoc.Form="Memo"

	mailDoc.sendTo="Herda Silverman"

	

	Set rtItem = New NotesRichTextItem(mailDoc,"Body")

	Call rtItem.appendDocLink(doc2,"Click here")

	Call mailDoc.send(False)

End If		

End Sub

Many thanks…

C

Subject: How do I make this a repsonse document?

You need to use the MakeResponse method of notesdocument. Check the designer help for an example.

cheers !!

Ashish

Subject: RE: How do I make this a repsonse document?

Hi

I tried this but got object variable not set…my script is not of the best…assume I have not declared something properly

Set db = session.CurrentDatabase

Set view = db.GetView( "(CheckMeetingDate)" )

Set doc = view.GetFirstDocument



If doc.IENEventDate(0) < Today Then

	

	'Set doc2 = db.CreateDocument

	Set itemB = doc2.MakeRepsonse ("Form",  "CFRF" )	

	Set itemA = doc2.AppendItemValue ("IENCompany", Doc.IENCompany )

Thanks again…

Subject: RE: How do I make this a repsonse document?

From the help :

MakeResponse method

Example

Makes one document a response to another document. The two documents must be in the same database.

Defined in

NotesDocument

Syntax

Call notesDocument1.MakeResponse( notesDocument2 )

Parameter

notesDocument2

The document to which notesDocument1 becomes a response. If you specify Nothing, this method will generate an error.

Usage

You must call Save after this method if you want to save the change you have made.

Subject: RE: How do I make this a repsonse document?

HiThanks for advice…

I did the following:

Set view = db.GetView( “(CheckMeetingDate)” )

Set doc = view.GetFirstDocument

'Set doc2 = view.GetNextDocument(doc)

'While Not ( doc Is Nothing )

If doc.IENEventDate(0) < Today Then

	

	Call doc.MakeResponse( doc2 ) 

	doc2.Form = "CFRF"		

It is still doing weird things…my view just contains a list of meetings by date and company name…

It does create the response but does not display it in the view which displays response docs linked to meetings…

C

Subject: RE: How do I make this a repsonse document?

You need to tweak the view settings to display the response documents.

Indenting response documents

Indenting response documents beneath main documents is useful when readers want to see the progression of a discussion. You can display 32 levels of responses, with each level indented three spaces under its parent document.

The following view in a discussion database displays the threads of a discussion, organized by date.

Such a view requires that:

Users have access to response forms, whose types are Response and Response-to-Response.

“Show response documents in a hierarchy” is selected in the Options tab of the View Properties box and the document selection formula uses SELECT @All or contains a formula that allows response documents to be included, such as:

SELECT Form = “Action Item” | @IsResponseDoc

The view has a responses-only column.

Create the responses column directly to the left of the column under which responses are to be indented. Leave its title blank, make its width 1, and select “Show responses only” in the Column Info tab of the Column Properties box. Write a column formula that displays information about the response documents shown in the column, such as their authors or creation dates.

If this information is not enough, just create a new local database using the Discussion template ( which comes with lotus notes installation ). Create a document, add a response and check out the view design inorder to know how its done.

cheers !!

Ashish