I’d like to compose new document in another database than in current dtb and close current document. My code on button action is here:
Sub Click(Source As Button)
On Error Goto ErrorHandler
Dim session As New NotesSession
Dim doc As NotesDocument
Dim uidoc As NotesUIDocument
Dim newUIDoc As NotesUIDocument
Dim db As NotesDatabase
Dim ws As New NotesUIWorkspace
Dim answer As Integer
Dim RequestPath As String
Set db = session.CurrentDatabase
Set uidoc = ws.CurrentDocument
Set doc = uidoc.Document
If uidoc.EditMode Then
uidoc.Save
uidoc.EditMode = False
End If
doc.fRequest = "Requested"
doc.fICTnotified="1"
RequestPath= GetSetting("fRequestpath")
If doc.fPC(0)="YES" Then
answer = Messagebox("Do you want to create purchase request for PC?",4+32,"Question")
If answer = 6 Then
Call ws.SetTargetFrame("")
Set newUIDoc = ws.ComposeDocument(db.Server,RequestPath,"frm_Requests_PO",,,True)
Call newUIDoc.FieldSetText("fPurchaseLocation","B")
Call newUIDoc.FieldSetText("fRequestType","ICT")
Call newUIDoc.FieldSetText("Subject","PC for new employee "+doc.fFullName(0))
Call newUIDoc.FieldSetText("fUnitPrice","1000")
Call newUIDoc.Refresh(True)
End If
End If
Call doc.Save(False,True)
uidoc.Close
ErrorHandler:
If Err=-28363 Then
Resume
End If
End Sub
If my current document is not in edit mode, new document in other dtb is composed ok, but if current document is being edited I am always getting the user defined error. it’s not error 28363 from post I found there
My lotus is complete down.
Any ideas how to fix this?
help much appreciated