Skip to main content

Notifications

Announcements

No record found.

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

ShortCutKey - Property

Posted on by 68
Hello, 
 
I have read these articles:
 
I want the user be able to use the shortcutkey.
However i dont want the action to be visible to the user.
If i set the Visible property to false i can no longer use the shortcut. 
If i set the visible to true and the editable to false, i can also no longer use the shortcutkeypropery.
 
            action("test")
            {
                Caption = 'test';
                Promoted = true;
                Visible = true;
                Enabled = false;
                ShortcutKey = 'Ctrl+F6';
                ApplicationArea = All;
                trigger OnAction()
                begin
                    ShowField := true;
                    Message('HalloWelt');
                end;
            }
 
Is there anyone who has a solution?
Thanks in advance, 
Dear Community
 
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 73,647 Super User 2024 Season 2 on at
    ShortCutKey - Property
    I personally don't think it makes any difference to display the action on the page. If the client minds this, then do all unused actions on the standard page have to be hidden?
    I think you can try to convince them. Although it may be a bit difficult.
     
     
    Thanks.
    ZHU
  • Suggested answer
    SÖ-17061501-0 Profile Picture
    SÖ-17061501-0 68 on at
    ShortCutKey - Property
    First of all, thank you for your thoughts. 
    After thinking about this technical problem, i have come to the conclusion that it is not possible
    to solve this problem via ShortCutKey property. 
    I must talk to the client and propose to solve this problem via a flag in the permission set. 
     
    Thanks to 
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 73,647 Super User 2024 Season 2 on at
    ShortCutKey - Property
    I also think Mohamed's approach is correct, you can only find a way to disable the code from running, you can't hide it.
    You can consider not promoting the action so that users can't find it so easily.
     
     
    Hope this helps.
    Thanks.
    ZHU
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    Mohamed Amine Mahmoudi 9,553 Super User 2024 Season 2 on at
    ShortCutKey - Property
    Hi,
     
    I think you can add if statement in your trigger method to prevent the execution of code :
    for e.g.
    trigger OnAction()
    begin
       if showField = tue then begin
       // Your Logic Here
       end;
    end;
    Best regrds,
    Mohamed Amine MAHMOUDI

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 Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans