Make Short Description & Description Read only on submit of incident form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2022 12:25 AM
Hello All
Make Short Description & Description Read only on submit of incident form
Plz let me know how to do it.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2022 12:55 AM
You mean when you click on submit button fields should be grayed out?
If so, not sure what you are trying to achieve with this. Either make it post or make it pre-submit.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2022 12:38 AM
Hi,
so are you saying once incident is created then you need both fields readonly and not during creation?
if yes then use onLoad client script
function onLoad(){
if(!g_form.isNewRecord()){
g_form.setReadOnly('short_description', true);
g_form.setReadOnly('description', true);
}
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2022 12:46 AM
Thanks,But I want the field readonly once i submit the form

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2022 01:05 AM
and what happens if someone tries to change from list view ?
first you need to ask yourself - r u trying to control access of fields or something else
if its access control of fields for specific user / condition then ur answer is acl
with client script it doesnt make sense to make fields read only post submission if u want users not to change things
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2022 01:32 AM
your requirement is not clear. what's your business requirement?
why to make it readonly when form submits? I didn't get that part.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader