replication save conflict when using makeresponse class

Hi I'm using the following script to turn a document into a response doc then saving but after I run the agent the response docs do not show up in a view using a select form used.  The response docs seem to become a replication save conflict.  What am I doing wrong here?

Sub Initialize
     Dim session As New NotesSession
     Dim db As NotesDatabase
     Dim classview As NotesView
     Dim studentview As NotesView
     Dim classdoc As NotesDocument
     Dim studentdoc As NotesDocument
     Dim tempdoc As NotesDocument
     Dim key As Variant
     Set db = session.CurrentDatabase
     Set classview = db.GetView( "classes" )
     Set studentview = db.GetView("Students")
     Set studentdoc = studentview.GetFirstDocument()
     While Not (studentdoc Is Nothing)
          key = studentdoc.ClassID
          Print key(0)
          Set classdoc = classview.GetDocumentByKey( key(0) )
          Call studentdoc.MakeResponse( classdoc )
          Set tempdoc = studentview.GetNextDocument( studentdoc )
          Call studentdoc.Save(True, False)
          Set studentdoc = tempdoc
     Wend
     
End Sub
sbaekAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ArunkumarCommented:
Hi there !

Check the following...

1. is the form for student a respose one ?

2. Try studentdoc.Save(true,true)

3. Before saving use computewithform option.

And why do you want to say studentdoc = tempdoc ?

Good Luck !

:)
Arun

PS:  Alternatively try and create a $Ref field on the student doc to refer the classdoc's Document ID.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sbaekAuthor Commented:
Check the following...

1. is the form for student a respose one ?
Yes

2. Try studentdoc.Save(true,true)
I've already tried it and if the first parameter is true the second one doesn't even matter.

3. Before saving use computewithform option.
Not sure what this does exactly.

And why do you want to say studentdoc = tempdoc ?

Once I save the a doc it goes to the end of the view and I can't pick the next one.  This way I already have the next document and I don't receive any errors.

I think I figured out what I was doing wrong though thanks.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.