I want to add role to the buttons

mania
Tera Contributor

Hi,

 

We have one HR item, Buttons to be visible to users with this role. HR Support, HRIS, role called 'ABC_HR'.

I have created 'ABC_HR' role and added to the HR Support, HRIS groups to that role.

I want to show the buttons only this particular role users in HR item.

 

Thanks!

 

4 REPLIES 4

tharun_kumar_m
Mega Guru

Hi Mania,

 

1. Please navigate to System Definition -> UI Actions.

2. Open the UI Action record which you would like to configure and in the condition field of the UI action, add the below code to the existing condition.

 

gs.hasRole('ABC_HR')

 

 

If my answer has helped with your question, please mark my answer as accepted solution and give a thumbs up.

 

Best regards,

Tharun Kumar

@tharun_kumar_m 

Thanks for your Responding!

 

I have tried the same but not working.

 

Can you please give any alternative solution. It will be usefull.

 

Thanks!

Hi Mania,

 

You can also use gs.getUser().isMemberOf('HR Support')

 

Please ensure the your record looks similar to my record below.

tharun_kumar_m_1-1712581575271.png

 

There could be any error on your script which could cause the issue. Please ensure there is no error in your script or condition fields.

 

If my answer has helped with your question, please mark my answer as accepted solution and give a thumbs up.

 

Best regards,

Tharun Kumar

@tharun_kumar_m 

 

Tried both ways but not working.

 

Thanks!