How to Disable ESC Key in Navision Classic


Hi all,

Sometime User want to force the user to click on the Cancel button instead of pushing the Esc key.

This can be done From in Navision from Tools Menu in Navision Menu and select Options.

There is an option Close Forms On Esc which is by default set to YES, set it to No.

Refer to screen below.



This option will set the ESC Disabled for all objects.

If we want to customize this for a specific form follow steps below -

1. In the form declare a Boolean variable i.e. OverwriteEsc.
2. Set the Cancel property of the Cancelbutton to No
3. In the OnPush trigger of the Cancel button and Ok button: OverwriteEsc := TRUE;
4. In the OnQueryClose Trigger of the form: EXIT(OverwriteEsc);

Thanks & Regards,
Saurav Dhyani
http://saurav-nav.blogspot.com/