UI Policies-Make field read only in review state

Kajal2
Kilo Contributor

UI Policies-Make field read only in review state

Hi,

I am writing a script for making the fields read only for a particular state(Review). I want the member of a specific group(member of IT_GRC(sys_id+76c540dbdb8cd090c7d99c18db961941)) only should be able to edit the form, what should I put in the script!!

function onCondition() {
var currentUser = g_user.userID; //stores the logged in user in currentUser


if (currentUser !=What shoul I put here?) {
var fields = g_form.getEditableFields();


for (var x = 0; x < fields.length; x++) {
g_form.setReadOnly(fields[x], true);

 

}
}
}

If any other changes required in the script, please let me know

 

Regards,

Kajal

1 ACCEPTED SOLUTION

Hi Kajal,

It is happening due to OOB UI policy with short description - "PE Reason read only and mandatory condition". You can update it accordingly.

Let me know in case of any queries.
If you think my response is helpful for you? If yes, mark it as correct answer and close the loop so that it would help future readers as well.

Regards,
Deepankar Mathur

View solution in original post

12 REPLIES 12

Hi Kajal,

Is it happening before you added the review state or it is happening before that as well?

What role does the requester has?

Regards,

Deepankar Mathur

Ed13
Tera Contributor

Hi Kajal,

 

Instead of the UI Policy script you could try with an ACL that is for write only. You need to give access to the table itself and another one for the fields. In the ACL built for the fields you can add the following: 

The script piece should determine who has write access or not. In your situation the members part of the GRC group. 

 

Thanks,

Eduard N.

find_real_file.png

Kajal2
Kilo Contributor

Should I make a completely New ACL and delete the changes I have made uptill now, i.e backgroud script, client script and UI policies and added conditions in the existing ACL?

Please clarify

Thanks