Issue setting field to readonly
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2024 09:16 PM
I'm trying to toggle the read-only property of the Next Step field (u_next_step) on the Service Record screen. I have tried two approaches (UI Policy and Client Script) and neither approach works. I know the code is being executed as I have added log statements to the console. I also in the same code set sys_created_on to read-only (just to see that it works) and that field is being set to read-only while Next Step is not. Both fields are initially editable in the form design. When I create a new SR, the form loads and the Created field is grayed out but the Next Step field is not.
Here is the client script code:
And here are the console statements
I'm sure this should be really simple, but I can't figure it out. Any help would be greatly appreciated. Thx.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2024 10:35 PM
Hi @Mark9 ,
Change UI type of client script to All. Might be your Ui type is desktop.
Please Mark my Solution as Accept and Give me thumbs up, if you find it Helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2024 11:27 PM
The UI Type is All
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2024 10:43 PM
Hi @Mark9,
Please check the field's dictionary wheteher mandatory checkbox is true.
Thanks
Jitendra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2024 11:27 PM
No it is not mandatory
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2024 10:44 PM
Hi @Mark9 ,
There is no issue with code I checked in my PDI may be the issue is field sys_created_on and u_next_step may be mandatory from may be UI Policy or other Client Script or Configure Dictionary.
So that's why these 2 fields are not getting ReadOnly.
Please mark my answer correct and helpful if this works for you
Thanks and Regards
Sarthak