Most Save & Close buttons don't account for QuerySave
events or field validation formulas that might find invalid data and stop the save. You can tell you have such a button when it asks you a second time if you want to save the document, even after a pop up has told you that you've entered some data incorrectly or left a field blank.
The fix is easy. Make your Save & Close button LotusScript, and just write code similar to the following into the Click
event:
On Error Goto oopsie ' in this case, this will simply stop execution Dim w As New NotesUIWorkspace Dim uidoc As NotesUIDocument Set uidoc = w.CurrentDocument Call uidoc.save Call uidoc.close Exit Sub oopsie: Exit Sub
Now if the QuerySave
event or validation formulas trap an error, your code will simply stop execution after the call uidoc.save
line, so it won't execute the call uidoc.close
line. This may seem like a lot of work to simply stop an extra pop up from annoying users, but in this...