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

UI Policy: set field to read only when not empty - ends up being read only all the time?

ServiceLater1
Giga Contributor

I have a field on a form. I have created a UI Policy to set it to read-only when the field is not-empty.

When I impersonate a user and test it, the field is read-only all the time whether empty or not. Am I missing something here?

1 ACCEPTED SOLUTION

Abhijit4
Mega Sage

Hi,

Inactivate UI policy and check if that field is editable for that user. If that is the case then ACL is restricting edit access for that user.

If field is editable after inactivating UI policy then make sure that onLoad checkbox is checked in UI policy.

Let me know if you have any further queries.

Please mark this as Correct or Helpful if it helps.

Thanks and Regards,
Abhijit
Community Rising Star 2022

By marking my response as correct or helpful, you contribute to helping future readers with similar issues.
Regards,
Abhijit
ServiceNow MVP

View solution in original post

2 REPLIES 2

Abhijit4
Mega Sage

Hi,

Inactivate UI policy and check if that field is editable for that user. If that is the case then ACL is restricting edit access for that user.

If field is editable after inactivating UI policy then make sure that onLoad checkbox is checked in UI policy.

Let me know if you have any further queries.

Please mark this as Correct or Helpful if it helps.

Thanks and Regards,
Abhijit
Community Rising Star 2022

By marking my response as correct or helpful, you contribute to helping future readers with similar issues.
Regards,
Abhijit
ServiceNow MVP

poornima srivas
Kilo Contributor

hi,

first step- set condition ->'field name'= is not empty

second step- write script

g_form.setReadOnly('field_name',true);

 

 

Regards,

Poornima