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

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

Placing an action item in Role Center Page where action item has to be displayed only for user with appropriate permissions

(0) ShareShare
ReportReport
Posted on by 437

Hi All,

system: BC19

deployment: OnPrem.

issue: solution to display/hide button (action item) on the RoleCenter Page if user has the appropriate permissions -> display/hide button dynamically, based on users' permissions.

Detailed description:

Since Page of type RoleCenterPage cannot have triggers, I have moved the code to the custom Codeunit, where I am calling the code as the custom Page RoleCenterPage is being opened.

I have created a new Action item (button) on the custom page of type RoleCenterPage.
This button has to be displayed only if user has appropriate permissions, thus I placed a new field that is used as setup (applied the role ID from the Table "permission set".Role ID"). and I applied same permission set to the user on User Card.

Now, on the EventSubscriber of RoleCenter Page using OnOpenPageEvent I placed the procedure to check if user has appropriate permissions, then action item is visible, else it is hidden (Visible property is set to true/false), but the issue is that somehow it seems that EventSubscriber is not event triggered at any time.

I tried with EventSubscriber to the CU9170 - Conf./Personalization Mgt. using OnRoleCenterOpen and OnAfterGetDefualtRoleCenter, and again it seems that EventSubscriber is not being triggered.
And, I also tried with EventSubscriber to the CU40 - LogInManagement, using the OnBeforeCompanyOpen and OnAfterCompanyOpen, but the code does not compile saying that it would increase the login time -> I read that code should be moved from these events OnBeforeCompanyOpen, OnAfterCompanyOpen.

Can you pleas advice where should I place the procedure that will be called as RoleCenterPage is being opened, or as user is opening the company?

Thanks Damjan 

I have the same question (0)
  • Suggested answer
    Marco Mels Profile Picture
    on at

    Hello,

    We currently do not have dedicated Dev support via the Dynamics 365 Business Central forums, but I wanted to provide you some additional resources to assist. If you need assistance with debugging or coding I would recommend discussing this on one of our communities.

    www.yammer.com/dynamicsnavdev

    www.dynamicsuser.net/.../14

    I will open this up to the community in case they have something to add.

    Thanks.

  • Suggested answer
    Amit Baru Profile Picture
    3,037 on at

    Hi,

    In Role center we cannot visible or hide actions items user wise. for that you have to create role center user wise.

    Regards

    Amit Sharma

    www.erpconsultors.com

    https://www.linkedin.com/in/amit-sharma-94542440/

    Pls press Yes if info is useful.

  • Suggested answer
    Jeffrey Bulanadi Profile Picture
    8,760 on at

    Hi Damjan,

     

    You can try the following events.

     

    CU LogInManagement

    Function:

    OnAfterLogInStart Function.

     

    CU Conf./Personalization Mgt.

    Function:

    OnAfterGetDefaultRoleCenter

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,226

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 2,047 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,257 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans