Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Suggested answer

How to implement Keyboard shortcut keys on D365FO form custom button control?

(0) ShareShare
ReportReport
Posted on by 75

Hello AXperts,

I wanted to create an user defined keyboard shortcut, let's say if I press (ALT+ P ) it should click form custom pure button created using form extension.

I have already come across the below link but I am not sure how and where this can implemented. Can any AXperts provide an example or a pathway on how to achieve this user defined keyboard shortcut. Also is it possible only using JavaScript? How does the OOTB Keyboard shortcuts were implemented in D365FO forms, examples please.

https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/user-interface/keyboard-shortcuts-controls#define-a-keyboard-shortcut

Shortcuts: {
    Save: {
        Keys: { ctrl: true, keyCode: $dyn.ui.KeyCodes.letterS },
        Handler: function (evt) {
            var control = evt ? $dyn.context(evt.target) : undefined;
            this.executeShortcuts(true, "SaveRecord", control);
        },
    },
    New: {
        Keys: { alt: true, keyCode: $dyn.ui.KeyCodes.letterN },
        Handler: function (evt) {
            var control = evt ? $dyn.context(evt.target) : undefined;
            this.executeShortcuts(true, "NewRecord", control);
        },
    },
    Delete: {
        Keys: { alt: true, keyCode: $dyn.ui.KeyCodes.deleteKey },
        Handler: function (evt) {
            this.executeShortcuts(false, "DeleteRecord");
        },
    },
    // Additional code
}

Other information:

Version : D365FO 10.0.11

Thanks Pradeep

  • Arun Karnik Profile Picture
    Arun Karnik 57 on at
    How to implement Keyboard shortcut keys on D365FO form custom button control?
    Hello Pradeep,
     
    Were you able to achieve Keyboard shortcuts with this approach?
    We couldn't find all KeyCodes possible for this. Were you able to find any documentation for this?
     
     
    Thanks,
    Arun
  • Suggested answer
    vinitgoyal2005 Profile Picture
    vinitgoyal2005 6,330 on at
    RE: How to implement Keyboard shortcut keys on D365FO form custom button control?

    Hi,

    This link you shared is for extensible controls. I don't think you can add a new shortcut for a particular button the way we used to do it in AX 2012 with keytip property.  

  • RE: How to implement Keyboard shortcut keys on D365FO form custom button control?
    [quote user="Anup Shah"]

    We have predefined short cuts, you mean to say create new one that are not already on this list: docs.microsoft.com/.../shortcut-keys

    [/quote]

    Yes, need to create a new one (Alt+P).

  • RE: How to implement Keyboard shortcut keys on D365FO form custom button control?

    We have predefined short cuts, you mean to say create new one that are not already on this list: docs.microsoft.com/.../shortcut-keys

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,431 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,503 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans