Hide Button on role center

Hello,

I’d like to hide a button on role center from code using visible proriety, so I declared a variable named “hideBt” with IncludeInDataset = yes.

I put hideBt in visible propriety of control to hide.

I tried to change a value to false in OnInit trigger and OnOpenPage tirgger but it doesn’t work !!

How could I do it ?

Thank’s for your help.

When you tried to add the code in OnOpenpage trigger of Rolecenter page, what did you get?


Microsoft Dynamics NAV Development Environment

No trigger code is allowed on pages of type Role Center.

OK

so you must have understood the result. :slight_smile:

I put

hideBt := FALSE;

I got nothing ! (le button was still visible)

In which page did you write the code?

In page :

9063 Purchase Agent Activities

True but not possible I guess…

why do you want to do this? what exactly is your requirement?

On this page I can show 5 buttons, it depend on the user permission,

For example :

If is the user1 I show only first button, if is the user2 I show the last button etc …

Why cant you use 2 different role centers for user1 and user2

Hi raf,

Did you ever find a solution to your problem? If you did, would you mind sharing it with us and if any of the posted answers helped you on the way, then please verify them.

Thank you.