- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2024 11:14 AM
Hi,
We need to make a variable on a record producer read only. It will be editable after incident is submitted, but should be read only for incident is closed. Please assist.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2024 01:55 PM
When the form is saved, it reloads, so you also need a similar onLoad Client Script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2024 01:55 PM
When the form is saved, it reloads, so you also need a similar onLoad Client Script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2024 02:09 PM
I have removed isLoading condition from onChange script, its working now. Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2024 12:57 PM - edited ‎10-04-2024 12:57 PM
Hi @sath
You can use below syntax in your client script to make variable read-only
g_form.setReadOnly('variables.variablename',true); //replace variablename
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2024 01:35 PM
With the above script, when I change incident state to resolved, the field is being set to read only, but it becomes editable once i save the form.