Shortcut Key for Menu Item on Form

hburmanhburman Member Posts: 4
I am creating a new menu item on a form. For that menu item I have added some logic on the OnPush action to call an external program using the SHELL command and feeding parameters to this external application. I have gotten that to work.

Now I want to add a shortcut key to that menu item to execute it via a funtion key shortcut. However, it seems like when I create a function key shortcut (on the MenuButton - Menu Designer form), it does not seem to be executing the OnPush logic. The ShortCutKey only seems to be able to use pre-defined actions (RunObject, RunSystem, Lookup Table, etc.) on NAV objects (Forms, Codeunits, etc.).

My question, is there a way to have the ShortCutKey launch the OnPush logic of the menu item on a form? Otherwise, it looks like I will need create a codeunit that does the same logic as my OnPush logic for the menu item. And I will have to create the ShortCutKey to execute that CodeUnit.

Thanks for the assistance,
Harold B.

Comments

  • MBergerMBerger Member Posts: 413
    Just tried it, but code gets executed when using a shortcutkey on a menuitem here. what shortcut did you use ?
  • couberpucouberpu Member Posts: 317
    hburman wrote:
    I am creating a new menu item on a form. For that menu item I have added some logic on the OnPush action to call an external program using the SHELL command and feeding parameters to this external application. I have gotten that to work.

    Now I want to add a shortcut key to that menu item to execute it via a funtion key shortcut. However, it seems like when I create a function key shortcut (on the MenuButton - Menu Designer form), it does not seem to be executing the OnPush logic. The ShortCutKey only seems to be able to use pre-defined actions (RunObject, RunSystem, Lookup Table, etc.) on NAV objects (Forms, Codeunits, etc.).

    My question, is there a way to have the ShortCutKey launch the OnPush logic of the menu item on a form? Otherwise, it looks like I will need create a codeunit that does the same logic as my OnPush logic for the menu item. And I will have to create the ShortCutKey to execute that CodeUnit.

    Thanks for the assistance,
    Harold B.

    How you "format" your shortcutkey?
  • hburmanhburman Member Posts: 4
    Here are some more details:

    - Made my change on the Payables Invoice form. Added a couple of new menu items to the Invoice button in the Forms Designer.
    - On the new menu items, I set up a ShortCutKey of "Ctrl+b". But I did not set a value for Action, or RunObject.

    Is there a certain value I need to set up for the Action and/or RunObject that will execute the OnPush logic for the menu item? If you did get this to work, can you give me some more specifics on how your setup is different from mine?

    Thanks,
    -H
  • couberpucouberpu Member Posts: 317
    hburman wrote:
    Here are some more details:

    - Made my change on the Payables Invoice form. Added a couple of new menu items to the Invoice button in the Forms Designer.
    - On the new menu items, I set up a ShortCutKey of "Ctrl+b". But I did not set a value for Action, or RunObject.

    Is there a certain value I need to set up for the Action and/or RunObject that will execute the OnPush logic for the menu item? If you did get this to work, can you give me some more specifics on how your setup is different from mine?

    Thanks,
    -H

    Did you try to use Ctrl+B instead of Ctrl+b yet?
  • hburmanhburman Member Posts: 4
    FIXED!! Yes, that was the fix. I used "CTRL+B" (all caps) instead of "Ctrl+b". It does overwrite it to "Ctrl+B" when I tab off the ShortCutKey field. Now when I hit that shortcut key combination, it launches the OnPush logic like I want it to. It would be nice if there was some type of reference key document for valid function key shortcut formats:

    - CTRL
    - SHIFT
    - ALT
    etc.

    Thanks again for the assistance,
    Sincerely,
    -H
  • DenSterDenSter Member Posts: 8,304
    Now that you know that the Ctrl+B shortcut works, you could experiment with other ones. I would personally put a simple C/AL command in the OnPush trigger, like MESSAGE('hello world'), and enter various key combinations, and test it.
Sign In or Register to comment.