Attain 3.60 - Create F-Key shortcut for buttons

Hi, I’m new to Attain (coming from the DOS-based original Navision) so I hope you don’t mind a “beginners question”. I’m looking for a tip on how to use the F-Keys as keyboard shortcuts within a navision form. My simple example form looks like this: Here the user is within the form table grid. The user enters some data and then has to press the OK button without touching the mouse. Currently this means the user has to press , move to the button with the key and select the button with I’m looking for a way to react to the F-Keys. To stay with this example: Any hints on how I can have the OK button pressed whenever someone presses F10 (no matter where the cursor is within the form) Regards, Martin Borus

Try edit the properties of the form and change it to Lookup mode. F10 - Try add menu Button with ShortCutKey = “F10”.

For commandbuttons you may set the Default property to Yes, and the button is selected when you press enter. Otherwise you create shurtcuts with the captions added. for example caption M&yButton has shoutcut Alt+y If you wish to use the F-Keys only solution is to change it to Menu-button and -items.

Nic, catching the F10 key does work this way, but I can’t access the code behind the “OK” button. The menu button C/AL offers only “OnActivate” and “ON Deactivate” - neither is executed when a keyboard shortcut is used. So I’m forced to leave the form code. I can use this to call a code unit - however if I need to licence every keyboard shortcut by buying an extra code unit my employer will not be too happy. Still thanks for the suggestion, this will at least do for the most important short cuts. Regards Martin Borus

If the form is not in Lookup mode, you can add at command button with the caption &OK. This way the user can press ALT+O to “Push” the ok button. OnPush() // code MESSAGE(‘OK Pushed’); CurrForm.CLOSE; If you use Lennart’s property Default = Yes, the user only need to push ENTER to activate OnPush()