- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-19-2021 07:35 AM
hi guys,
I have a UI policy which makes the PIR fields in a change form read-only.
However I don't want this UI policy to run if the user has role change_manager.
How can I put this in the UI policy script to take affect please?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-19-2021 07:55 AM
You could also modify your UI Policy and, instead of using an action to set the fields read only, use the run scripts option and in your script for true, use something like this.
function onCondition() {
if(!g_user.hasRoleExactly('change_manager')) {
g_form.setReadOnly('<name_of_field>', true);
}
}
That would get the job done as well.
I hope this helps!
If this was helpful or correct, please be kind and remember to click appropriately!
Michael Jones - Proud member of the CloudPires team!
Michael D. Jones
Proud member of the GlideFast Consulting Team!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-19-2021 07:52 AM
This does not defeat the idea of using an ACL to protect the field. Create a write ACL for that field and configure it to allow editing it if the change has not been closed OR if the user is a change manager.
Blog: https://sys.properties | Telegram: https://t.me/sys_properties | LinkedIn: https://www.linkedin.com/in/slava-savitsky/

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-19-2021 07:55 AM
You could also modify your UI Policy and, instead of using an action to set the fields read only, use the run scripts option and in your script for true, use something like this.
function onCondition() {
if(!g_user.hasRoleExactly('change_manager')) {
g_form.setReadOnly('<name_of_field>', true);
}
}
That would get the job done as well.
I hope this helps!
If this was helpful or correct, please be kind and remember to click appropriately!
Michael Jones - Proud member of the CloudPires team!
Michael D. Jones
Proud member of the GlideFast Consulting Team!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-20-2022 08:13 PM
Thanks Michael, I had a similar scenario and adding this script to my UI policy is now allowing the change manager to edit the relevant fields that are read-only to all other users (however I take note of your comment that the requester would still be able to update these fields in the list view, which is why creating a 'write' ACL may be better).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-19-2021 07:55 AM
Please can you just tell me how do it via UI policy

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-19-2021 07:56 AM
See above answer, sorry. Just keep in mind, UI policy only stops users from editing those fields on the form view. They would still be able to edit them from the list view. May or may not be a concern for you.
Michael D. Jones
Proud member of the GlideFast Consulting Team!