The CreatorCon Call for Content is officially open! Get started here.

Read-only UI policy not working on one field

Farah5
Tera Contributor

I have 6 fields are required to be read-only based on the value of a previous field, pos_description. If pos_description = YES, then all 6 fields are read-only, else if pos_description = NO, then all 6 fields are not read-only. All of these fields are combined in one UI policy. 

These 6 fields are also visible/not visible, depending on the value of the field before each one. So if field1 is empty, then field2 will not be visible. If field1 is not empty, then field2 is visible. If field2 is empty, then field3 will not be visible, but if field2 is not empty, then field3 will be visible, and so fourth. Each of these fields have their own UI policy for that. 

The problem I'm encountering is that when pos_description = YES, all of fields are read-only EXCEPT for field2. If I disable the UI policy for field2, then it does become read-only, as expected. But I'm not sure what is it about that UI policy that's creating a conflict, and why it's different from any of the other fields, as they all have the same UI policy actions. 

find_real_file.png

This is the UI policy for all 6 fields to make them read-only:

find_real_file.png

 

This is the UI policy for field2

find_real_file.png

Neither UI policy has a script nor are there any client scripts. 

6 REPLIES 6

sachin_namjoshi
Kilo Patron
Kilo Patron

Use debug UI policies to find out root cause.

Also, use field watcher to find out what all code is running of these field.

https://docs.servicenow.com/bundle/orlando-application-development/page/script/debugging/concept/c_F...

 

find_real_file.png

Ashutosh Munot1
Kilo Patron
Kilo Patron

Hi,

You need to order them and in second UI policy make Reverse if false and test.

Thanks,
Ashutosh

DirkRedeker
Mega Sage

Hi

I guess you just need to change one value, which you can see in the sceenshot attached below:

find_real_file.png

Let me know if that works and mark my answer as correct and helpful.

 

Enjoy and BR

Dirk

 

Sorry, I don't see how this helps. Marking Mandatory as True means that the field will be visible when it's not supposed to be. And it still doesn't fix my issue, the field is still editable.