Making a field read only for user with role using UI policy

amacqueen
Mega Guru

I'm trying to make a field read only for a user with a specific role.

In the script associated with the UI Policy I have

function onCondition() {

gs.hasRole(x_9004_invoice_que.mgr);

}

We only have one user with this role however it is making the field read only for all users

Appreciate any assistance with this

1 ACCEPTED SOLUTION

Harish KM
Kilo Patron
Kilo Patron

Create a ACL to make the field readonly. It also restricts list view.


Regards
Harish

View solution in original post

5 REPLIES 5

Harish KM
Kilo Patron
Kilo Patron

Create a ACL to make the field readonly. It also restricts list view.


Regards
Harish

Was hoping to make it a bit simpler but that was the right answer.



Many thanks


sergiodecristo1
Mega Expert

Hello Angus,


is not a best practice but why u don't do a cliente script that with a if condition on role set fiel read only :



if(gs.hasRole(x_9004_invoice_que.mgr)==true){ g_form.setReadOnly(fieldName, true)};



Sergio



Hit Correct , Helpful etcetc...


Gaurav Bajaj
Kilo Sage

Hi Agnus,



You can try with below script




if(g_user.hasRole('x_9004_invoice_que.mgr')){



g_form.setReadOnly('field_name',true);



}



Please mark correct/helpful based on the impact of the response.




Thanks


Gaurav