Eliminating the option for a User to ESC a document

Is there a way for to disable the “Esc” option for closing a document? I want to force users to press an action button so I can check the document prior to exiting and saving.

Thanks, Paul

Subject: googled it

lotus-notes-force-save-button

http://searchdomino.techtarget.com/tip/Easier-Way-To-Force-A-User-To-Use-The-Save-Close-Button

Subject: Thanks

Thanks Paul but this is too vague for me. I was hoping for a canned set of code or some database setting that would disable the Esc key from doing anything.

Take care, Paul

Subject: But why?

Since you can do most things in many different ways in Notes, why would you want to force the user to click on a button?That is something new developers often seem to want, but disabeling the Esc key is not the answer. You still can close the document in other ways.

What you want to do is to put your logic/code in the QueryClose, QuesrySave and possible PostSave events. That way you can catch it no matter what the user does.

Your “Save & Close” button should just contain something like this:

@If(@Command([FileSave]); @Command([FileCloseWindow]); “”)

What that does is to attempt to save the document. If True is returned (i.e. document passes field validation), the document will close, otherwise teh user stay on the document.

That is the recommended way to do it. Then you simply add all yoru code and logic to QueryClose and QuerySave…

Subject: QuerySave

Have you tried writing code in the QuerySave event? You could check the document and either prevent saving or continue saving.

/Hans

Subject: Question on suggestion

Hans,

Thanks for your suggestion! Is there a formula language command that I can use to tell if the Esc key was used to exit the document?

Subject: Easy peasy to do

set a field noSave as true when the document is edited in the postopen

Now your buttons can set this field to false

Now check this field in your QuerySave event and set continue accordingly

Subject: sounds good but…

This sounds easy but how do I detect that the Esc button was pressed so I can set the field to false? What is the formula code?

Sorry for being so ignorant but I am self taught and just a beginner…

Thanks, Paul

Subject: You don’t

You detect whether or not the field has been setAs ESC won’t set the field, it fails

Your button WILL set the field, so it passes

Subject: Thanks

Christopher, thanks for your time but I still don’t get it. I really need very specific code since I am self taught and have no one around me to help. I am going to take the free script course though hoping it will help… when I find time.

Take care, Paul