I have an agent having uidoc.save.It calls the querysave event.In the query save event i have a statement continue=false.Because of this contradiction i got an error stating notesuidocument : save cancelled.I prevented the dialog box by using the following code
On Error Goto Errhandle
Errhandle:
'Error number 4411 corresponds to "NotesUIDocument:Save cancelled"
If ( Err = 4411 ) Then
Exit Sub
End If
But this prevents the document from being saved.
I need my document to be saved.Could anyone help me out in saving my document?
Subject: Notesuidocument " save cancelled
Hello Malar,
Why are you using Continue = False in QuerySave?
In the following code change Exit sub to Resume Next, It may help your cause… Saving document.
If ( Err = 4411 ) Then
'Exit Sub
Resume Next
End If
Let us know the results.
Best Regards,
Munish Kaushik
Subject: RE: Notesuidocument " save cancelled
hi,
I use continue = false as a part of my code.ie. It checks for certain validations and ends up in the statement assigning continue = false .I tried using “resume next”.It dint work out.
Could u help out with some other solution
Subject: RE: Notesuidocument " save cancelled
Hi,
Could you please put up your code here?
Regards,
Munish Kaushik
Subject: RE: Notesuidocument " save cancelled
Sub Initialize On Error Goto Errhandle
Dim db As NotesDatabase
Dim Session As New NotesSession
Dim ws As New NotesUIWorkspace
Set uidoc = ws.CurrentDocument
Set db = session.CurrentDatabase
Set docCurrent = UiDoc.Document
Call ClearAccessFieldsIfNoneSelected(docCurrent)
uidoc.Reload
uidoc.Save
Exit Sub
Errhandle:
'Error number 4411 corresponds to "NotesUIDocument:Save cancelled"
If ( Err = 4411 ) Then
Exit Sub
End If
End Sub
Sub Querysave(Source As Notesuidocument, Continue As Variant)
On Error Goto ErrorHandler
Dim strContinue As String
' Check for Approver&DSA before Field validation
strContinue = "False"
Call RequestorSetFullName ( "False" ) ' Requestor
Call EmployeeSetFullName ( strContinue )
If strContinue = "False" Then
Continue = False
Exit Sub
End If
<test of the code here>
Subject: RE: Notesuidocument " save cancelled
Hello Malar,
Please make the following changes to your code and it will work…
Sub Initialize
On Error Goto Errhandle
Dim db As NotesDatabase
Dim Session As New NotesSession
Dim ws As New NotesUIWorkspace
Set uidoc = ws.CurrentDocument
Set db = session.CurrentDatabase
Set docCurrent = UiDoc.Document
Call ClearAccessFieldsIfNoneSelected(docCurrent)
uidoc.Reload
uidoc.Save
OutOfcode:
Exit Sub
Errhandle:
'Error number 4411 corresponds to “NotesUIDocument:Save cancelled”
If ( Err = 4411 ) Then
Resume OutOfCode
End If
End Sub
Hope this helps…
Best Regards,
Munish Kaushik