Greetings,
I’m having some interesting trouble with the uiws.EditDocument function in LotusScript. Here’s the code I’m using:
=========================================
Sub Querysave ( Source As NotesUIDocument, Continue As Variant )
Dim uiws As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Set doc = Source.Document.ParentDatabase.GetView ( "PatByAcct" ).GetDocumentByKey ( Source.Document.AcctNum (0) )
If Not ( doc Is Nothing ) Then
Msgbox "A profile already exists for this patient! Press Ok to switch to the existing profile.",_
MB_OK + MB_ICONINFORMATION, "Profile already exists!"
Source.Document.SaveOptions = "0"
continue = False
Call Source.Close
Call uiws.EditDocument ( False, doc )
End If
End Sub
=========================================
The code basically looks to see if the profile exists (based on a unique ID, the AcctNum) and if it exists, I want to drop the user on the existing document.
The problem is that the EditDocument doesn’t open the existing document AT ALL. No errors are triggered; the code simply ends without opening the new document.
Here’s the catch…while the LS Debugger is active, the code works perfectly. As soon as I turn the debugger off, it stops working.
Any ideas would be most appreciated.
Dave