Skip to main content

Notifications

Business Central forum
Suggested answer

Detect F9 Key if pressed

Posted on by 751
Hello,
 
i want to check for F9 key if it is pressed and add a condition to exit a page.
is it possible in BC?

note: we can try on a test page just for simplicity to check if F9 key is pressed and show a message "F9 key is pressed".

Regards,
David
  • Yi Yong Profile Picture
    Yi Yong 752 Super User 2024 Season 2 on at
    Detect F9 Key if pressed
    Hello David,
     
     
    You can use Currpage.close() to exit the current page but it will not bring you back to the main menu.
     
    F9 shortcut key will not work on pages with existing action functions with F9 as their shortcutkey property.
     
  • David Tailor Profile Picture
    David Tailor 751 on at
    Detect F9 Key if pressed
    Hi Guys,
     
    thanks for your answers.
    small comment: the page in question has a type: CardPart, which has some fields for input.
    i need to detect if F9 is pressed to exit the page and return to the main page.
    hope i can achieve this.
     
    Regards,
    David
  • gdrenteria Profile Picture
    gdrenteria 9,387 Most Valuable Professional on at
  • Suggested answer
    Yi Yong Profile Picture
    Yi Yong 752 Super User 2024 Season 2 on at
    Detect F9 Key if pressed
    Hello David,
     
    You can use the 'ShortcutKey' to fulfil this, however, not all shortcut commands are usable.
     
    Refer to the below Microsoft Learn for the list of shortcut keys that are reserved.
     
     
    To exit a page with conditions, you can use the Trigger OnClosePage.

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,522 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,441 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans