Skip to main content

Notifications

Small and medium business | Business Central, N...
Suggested answer

Detect F9 Key if pressed

(1) ShareShare
ReportReport
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 1,450 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 12,290 Most Valuable Professional on at
  • Suggested answer
    Yi Yong Profile Picture
    Yi Yong 1,450 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

News and Announcements

Announcing Category Subscriptions!

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,359 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans