How to restrict access to a field in the incident form?

Bill11
Kilo Expert

I need either a Business rule or UI policy that will allow me to cause a field to become read only unless you have a specific role.  I tried using a script from SN but so far I have not gotten it to work.  The script was in a business role. 

functiononLoad();{
var incidentState = g_form.getValue('incident_state');
if( incidentState =='6'|| incidentState =='7'){
g_form.setReadonly('priority',true);}}

1 ACCEPTED SOLUTION

And also for write access to a particular role. create a write acl like below:

 

find_real_file.png

View solution in original post

13 REPLIES 13

Mohita Vats
Kilo Contributor

You can go with ACL.

Allen Andreas
Administrator
Administrator

Hi,

 

In your script above...it doesn't mention the role at all?

 

You also have a ; outside the function onLoad and that line is also annotated wrong.

 

It should look like:

 

function onLoad() {
//Type appropriate comment here, and begin script below

}

 

Enter your script in-between the {

 

}


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

Bill11
Kilo Expert

I have not messed with ACL's yet.  Would that be a better spot to do this? 

 

The script only turns the field read only.  Not sure how to write it to give access if the role is set as something.  In addition it kicks an error without the semi-colon

find_real_file.png

Create a read acl like below for locking up priority when state is x and y.

find_real_file.png