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