How to Visible Field based on user role (LIKE : change _manager) on change request ?

ram_sn2018
Kilo Contributor

How to Visible Field based on user role (LIKE : change _manager) on change request ?

Scenario : When ever Change manger group members login  that time only one more extra  field (Like : Author side ) field visible. Please help me ....

 

Thanks,

Ram

1 ACCEPTED SOLUTION

It's really quite messy to use a UI policy here I would recommend an onLoad client script or an ACL.

 

However if you simply must have a UI policy then you can create one with a condition that is always true

like number is not empty

reverse if false is off

run scripts true

Execute is true script

function onCondition() {
var hasRole = g_user.hasRole('change_manager');
if (hasRole ==true) {
g_form.setVisible('u_ram', true);
} else{
g_form.setVisible('u_ram', false);
}
}

 

I have tried this in a dev instance and it's fine but you are really better off using an ACL or client script

View solution in original post

11 REPLIES 11

scott barnard1
Kilo Sage

Create your extra field and then write a ui policy to only display it to members of a group.

If it needs to be more secure create a field level acl for read/write and link it to change manager role 

Thanks for your Response,

I Created Ui policy  but not work , please provide your Ui policy  or any other scripts.

My project condition , any hiding fields  is there , through ui policy to hide it .

 

 

Thanks

Ram

Ram

You can either use a policy based on a condition that is always true or you can write a client script.

For the client script Allen already had the code posted

So script type is on Load and as mentioned you want to use the ui type of All

Code as below

if (g_user.hasRole('change_manager')) {
g_form.setDisplay('u_field_name', true);
} else {
g_form.setDisplay('u_field_name', false);
}

replace the u_field_name value with the name of the field you wish to hide from non-change managers

 

Thanks.

If helpful, please mark as such.


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!