I have a Response document that is sent to a PDF server (ePDF Server) after the user clicks an Action on the Form. Because the ePDF Server cannot properly process response documents the $REF field must be removed prior to sending and reattached (using MakeResponse) after sending.
The Action calls a LotusScript Agent with the following code fragments:
:
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Dim parent As NotesDocument
Dim item As NotesItem
:
If Not uidoc.EditMode Then
uidoc.EditMode = True
End If
Call uidoc.Save()
If doc.IsResponse Then
Dim parent As NotesDocument
Set parent = doc.ParentDatabase.GetDocumentByUNID(doc.ParentDocumentUNID)
Set item = doc.GetFirstItem(“$REF”)
Call item.Remove() ’ ePDF Server does not accept response docs
Call doc.Send(False)
Call doc.MakeResponse(parent)
Else
Call doc.Send(False)
End If
Call doc.Save(False, True, True)
Call uidoc.Save()
:
This code works in most cases (several douzend times a day). However, in a very few cases the document looses its $REF field and I have no idea how this can happen.
Let me know if you have any idea what could cause this problem.
The code fragment shows any Save, Remove and Send mathods that are used in the code.
Peter