Hello all,I have a notes db similar to a discussion db. Has main docs and response docs.
But the customer wanted readers fields on them, certain ppl to see yadda yadda.
So I have a query save script running to update response docs, if there are any.
Here’s the problem: when saving the document, and the notes clients are 6.5.3, it is locking up their notes client. The document is getting saved, but its like its not ending a function or something, which makes me believe that my LS loop is screwy.
6.5.1 clients are fine. I have ruled out WAN and everything else and have come to the conclusion that it is my coding.
Could someone have a peek and correct me? i’m searching forums right now and will report back if I find anything. I have been searching for awhile now, that’s why i’m posting.
THANKS ANYONE!
******** START CODE **********
Sub Querysave(Source As Notesuidocument, Continue As Variant)
'Access the Parent DocID field from current UI Doc
'This DocID field contains the @Text(UniqueUnivesalID) data
'This returns the UNID as a string from the DocID field
'Variable ResponseDocID will be this @Text(UNID)
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim ParentDocID As String
Set uidoc = workspace.CurrentDocument
ParentDocID = uidoc.FieldGetText( "MainID" )
'Access View that contains all response forms
Dim session As NotesSession
Dim db As NotesDatabase
Dim view As Notesview
Dim doc As NotesDocument
Dim nextdoc As NotesDocument
Dim item As NotesItem
Dim ReadN As notesitem, AuthN As notesitem
Dim ReaderNames As NotesItem, AuthorNames As NotesItem
Set session = New NotesSession
Set db = Session.CurrentDatabase
Set view = db.GetView("$ResponseRequestLookup")
Set doc = View.GetFirstdocument
Set ReadN = uidoc.Document.GetFirstItem("ReaderNames")
Set AuthN = uidoc.Document.GetFirstItem("AuthorNames")
' Each Doc has the same DocID as the Response docs
' Now we look at each response doc and get the value DocID field
' Compare DocID field from parent to the DocID of the response
' If they are equal, then the response docs change automatically
While Not (doc Is Nothing)
ResponseDocID = doc.GetItemValue("DocID")
OldRN = doc.GetItemValue("ReaderNames")
OldAN = doc.GetItemValue("AuthorNames")
If ParentDocID = ResponseDocID(0) Then
ReadN.IsReaders=True
AuthN.IsAuthors=True
Call doc.replaceitemvalue("ReaderNames",ReadN.values)
Call doc.replaceitemvalue("AuthorNames",AuthN.values)
Call doc.Save( True, True )
End If
Set nextdoc = view.getnextdocument(doc)
Set doc = nextdoc
Wend
End Sub
************ end code ********