- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2023 08:58 AM - edited 12-14-2023 09:10 AM
Hello Gurus,
It might sound silly; however, I'm unable to set state readonly. I need your help.
We handle multiple projects and for one specific project, I want to set the state field readonly. By the way, state is inherited from task table(just for reference).
-I wrote UI policy for the following and it isn't working. I've debugged, it's getting into condition; however, not setting the field readOnly.
-I wrote onLoad CS, if state == 'abc', then set readonly. (g_form.setReadOnly and setDisabled aren't working!)Even this isn't working.
-I tried ACL, but it's restricting the write for state field (i want state to be changed as per other field changes).
here the catch is that the state field is set to read-only onLoad for 1 sec, then it's becoming editable. I've tried deactivating all other UI Policies, and Client scripts running on state but failed to achieve the result.
please provide your valuable suggestions
@Ankur Bawiskar @Sagar Pagar @Anubhav Ritolia @Ratnakar7 @Aravindhan Sundareswara
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2024 07:54 PM
definitely some script is doing that as you mentioned it's becoming read-only for 1 sec
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2024 07:54 PM
definitely some script is doing that as you mentioned it's becoming read-only for 1 sec
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2024 08:23 PM
Yes! there's an onChange script that sets other field read-only is causing this issue. It's because the other field has a condition to set the state editable. I found it and resolved it.. thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2024 10:05 PM
Hi @Nag89,
Yes. There may be other client scripts for UI policies on the same field that make it non-read-only
Thanks,
Sagar Pagar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2024 12:08 AM
Hi @Nag89 ,
Can you please confirm the field is mandatory?
If mandatory field then you can uncheck mandatory field and try.