- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2015 06:30 AM
I'm having trouble diagnosing why my UI Policies no longer work; I have created a custom form with custom buttons that update the stage located on form when selected. The stages that I have so far are "Define", "Design", and "Transition". All of the fields associated with each stage should not be editable when the form is in a different stage, and thus we have to make them read only.
The problem I'm having is that the fields linked with "Define" and "Design" are editable whenever the form is in either stage; however, when the form is in the "Transition" stage everything linked with "Define" and "Design" is read only as expected. All of these UI Policies are set up the same way and I can't figure out why two of them won't work when the last one does. I have disabled all associated client scripts on this table and other UI Policies on this table making fields mandatory, and I still have the same issues.
Out of curiosity, I set the UI Policies to hide the variables that are supposed to be read only on certain stages; the UI Policy successfully hides these fields. I checked the console log to see if anything was being tripped up and found that my condition for the UI Policies was being triggered and that the console log says that the fields are being set to read only... obviously that's not happening.
Is there any other area that I'm missing that may be causing the issue?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2015 08:40 AM
Hi Caitlyn,
I would recommend the following for making fields read only:
1. ACLs - Access controls are great because they run on the server and apply to both forms and lists. However, if you need the mark something read only based on a change on the form, they won't work.
2. UI Policies - These are nice because they require no scripting and you can order them. They also support pretty complex conditions, but they only really work for a condition or the opposite of that condition, so if you have a number of different conditions that have more than 2 outcomes, you might need to use a client script.
3. CS are all scripting so they can be more difficult to work with, but they can do everything a ui policy can do and more.
From your description it sounds like you might still be able to use a ui policy. Could you do something like:
Condition: Stage is 1 or 2
Action: Field is read only
And just separate it out in its own ui policy.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2015 07:30 AM
I would take a look at the field watcher and see if there are any other ui policies or client scripts affecting those fields.
Field Watcher - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2015 07:49 AM
Brad,
I turned on the field watcher, but I don't think there's anything else that's running on these fields: the screen is blank.
Seeing as I've never used field watcher, I don't know what to make of it.
Could a problem be that I need these fields to be read-only on load? The only time they would change is when the form is submitted and the stage changes.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2015 07:55 AM
When you say they're set read only on load does that mean you have the read only checkbox checked or you're managing through ACLs? If so, then your ui policies will not override those settings. If they need to be read only based on some conditions and you're using ui policies you should only be using ui policies.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2015 08:04 AM
Brad,
I am only using UI Policies - I haven't touched ACLs for this form at all.
What's getting me is is that I have three UI policies that are controlling the read only status based on the stage, and one of them works as intended. I'm not sure why the other two aren't cooperating.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2015 08:08 AM