Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Suggested answer

ShortCutKey - Property

Posted on by 33
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
 
Categories:
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 63,922 Super User 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 33 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 63,922 Super User 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 7,243 User Group Leader 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

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,773 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,513 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans