- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2025 09:57 PM
Hi,
I have gone through the community and some sources and found that setDisabled() will grays out the field and makes it unavailable. But when i try to apply it, i did not find that functionality. I did it as follows.
g_form.setDisabled('short_description', true)
So can anyone help me in it...
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2025 02:10 AM
To disable or gray out a field like short_description on a regular form (Incident, Problem, Change, etc.), you need to use different methods depending on whether you're working on the older UI or the newer Next Experience UI (Polaris).
For most cases, using g_form.setReadOnly('short_description', true); in your Client Script is the recommended way to gray out and disable the short_description field on a regular form. If you need a no-code solution, use a UI Policy. If you need to control access based on security rules, use an ACL. Remember to test thoroughly in a development instance before deploying to production!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2025 01:33 AM
difference is explained here
What is difference between setReadOnly() and setDisabled() function?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2025 02:10 AM
To disable or gray out a field like short_description on a regular form (Incident, Problem, Change, etc.), you need to use different methods depending on whether you're working on the older UI or the newer Next Experience UI (Polaris).
For most cases, using g_form.setReadOnly('short_description', true); in your Client Script is the recommended way to gray out and disable the short_description field on a regular form. If you need a no-code solution, use a UI Policy. If you need to control access based on security rules, use an ACL. Remember to test thoroughly in a development instance before deploying to production!