Book Image

Domino 7 Application Development

Book Image

Domino 7 Application Development

Overview of this book

Written by Lotus insiders, the book provides a practical guide to developing applications making use of the important features and enhancements introduced in Notes/Domino 7. These experienced experts use their own experiences to map out the benefits you could gain, and the dangers you may face, as you develop Domino applications in your business. Written by specific experts, edited and overseen by Lotus content generator Dick McCarrick, this book is the definitive guide to developing Domino 7 applications. TECHNOLOGY Domino is an application server that can be used as a standalone web server or as the server component of IBM's Lotus Domino product which provides a powerful collaborative platform for development of customized business applications. It also provides enterprise-grade email, messaging, and scheduling capabilities.
Table of Contents (18 chapters)
Domino 7 Application Development
Credits
Foreword
About the Authors
About the Reviewer
Preface
Free Chapter
1
A Short History of Notes and Domino

The Save & Close Action Bar Button


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...