how to hide New button on related list for particular roles

siva58
Tera Contributor

i need to hide new button on  related list for manager and employee.

 

siva58_0-1667319638129.png

 

11 REPLIES 11

Hello,

 

In the native UI you can just add the or condition as below:-

 

answer=true;
if(gs.getUser().hasRole('rolename1')|| gs.getUser().hasRole('rolename2'))
{
answer=false;
}

 

But in the workspace as I had mentioned you cannot use the list control.

 

Please mark my answer as correct based on Impact.

Rana5
Tera Expert

You can control the New button visibility from the List Control:

 

Go to your Related List > Right click > Configure > List Control

 

From here you can either use the "New roles" field and define the roles that should see the New button. You can also add necessary script under "Omit new condition" script block.

 

Regards,

Rana