web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Disable an Action in Role Center

(1) ShareShare
ReportReport
Posted on by 27

Hi Expert,

I Create a custom Role Center and in this Role Center i create  an Action 

this my Action 
action("Add")
            {
                ApplicationArea = All;
                Caption = 'Add';
                RunObject = Page "Customer";
                Enabled = ActionIsActivated();
                ToolTip = 'Specifies the value of Add action.';
            }
what i want is to control the value of enabled so i create a procedure 
 
 local procedure ActionIsActivated() : Boolean
    var
        lCashRegBoRoleCenter: Record "Cash Reg. B.O Role Center MMN";
        IsAtivated : Boolean;
    begin
        lCashRegBoRoleCenter.FindFirst();
        IsAtivated := lCashRegBoRoleCenter.IsActivated;
        exit(IsAtivated);
    end;
but the problem is always return false even if I emptied the procedure it return false
 local procedure ActionIsActivated() Boolean
   
    begin
   
    end;
if someone has a suggestion to solve this problem
I have the same question (0)
  • Suggested answer
    Govinda Kumar Profile Picture
    2,304 Moderator on at

    Even after emptying the procedure returns false because the default value is false, you need to make sure that your code is being debugged and double-check the IsActivated value of your first record. By the way, which section of the role center page are you adding this action?

  • Khadija  Profile Picture
    27 on at

    I add this action in creation section

    for debugging i add an error message but it's not appearing.

    and there is no problem in the value of the first record

    even if the value of the first record is true the procedure return false

  • Suggested answer
    Govinda Kumar Profile Picture
    2,304 Moderator on at

    if you are unable to debug the procedure.. then it could mean that procedure is not returning any value even if you manually return 'true,' it will still be considered false.. so it might not be possible to achieve your goal using a method in Role Center page.

    One possible solution was to use a global variable and update its value according to your requirement... but again none of the triggers work on role center page.. so I don't think you can use any variable or method to update the enability of your action.. the only way you can do is by using direct value as true or false..

    Regards

  • Khadija  Profile Picture
    27 on at

    this is the problem the triggers does not work in role center page, and that why i use a procedure but also does not work

  • Suggested answer
    Govinda Kumar Profile Picture
    2,304 Moderator on at

    Unfortunately, you cannot use variables or methods to control the visibility/enability of actions on Role Center page. If your requirement is essential, you may consider using AccessByPermission on your action property or using personalization or user permissions to see if it meets your requirements.

    Regards

  • Prajakta Raut Profile Picture
    18 on at
    Hi,
     
    If you found a solution for this issue, please revert the solution. I am facing the same issue.
     
    Thank you in advance!
  • Suggested answer
    YUN ZHU Profile Picture
    98,231 Super User 2026 Season 1 on at
    As far as I know this cannot be done, the easiest way to think about it is to copy another Role Center and hide this button on it.
     
    Thanks
    ZHU

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,055 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,063 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 1,014 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans