[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 331
  • Last Modified:

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
0
sbaek
Asked:
sbaek
1 Solution
 
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
 
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

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now