gbentley
asked on
Close Button
I am developing an app in Notes and have a problem working out how to code the error checking.
What I am trying to achieve is to have two Actions available when editing a document. "Save&Close" will check the data is valid, and if so save and close the document without further prompts or messages. If there are errors, the user is informed, and the document is not saved.
Secondly a "Cancel" button that does exactly that, closes the document without saving any changes and without any other messages or prompts.
I can get this mostly working by coding the error checking in the Save&Close action, and then calling .Save and .Close for the UIDoc if there are no problems. The problem is the Cancel Action. When I call the UIDoc.Close action Notes displays a dialog prompting the user to Save the new document. If they click yes, the document is saved regardless of any problems.
How do I close an open document without saving and without prompting the user no matter what the state of that document? It could be a new document or an existing one, and there may or may not have been changes made.
Thanks
What I am trying to achieve is to have two Actions available when editing a document. "Save&Close" will check the data is valid, and if so save and close the document without further prompts or messages. If there are errors, the user is informed, and the document is not saved.
Secondly a "Cancel" button that does exactly that, closes the document without saving any changes and without any other messages or prompts.
I can get this mostly working by coding the error checking in the Save&Close action, and then calling .Save and .Close for the UIDoc if there are no problems. The problem is the Cancel Action. When I call the UIDoc.Close action Notes displays a dialog prompting the user to Save the new document. If they click yes, the document is saved regardless of any problems.
How do I close an open document without saving and without prompting the user no matter what the state of that document? It could be a new document or an existing one, and there may or may not have been changes made.
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks
Gordon