Make variables on the target record read-only in workspace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-14-2022 07:00 AM
Hi All,
We have a requirement to make the default variable editor read-only in the target record. We have written script as per https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0752560 which makes the variable editor read-only in native UI. However, variables are still editable from the workspace. We have tried a client script with g_form.setVariablesReadOnly(true) on target record but its not working either. Any idea on how we can make the variables read-only on the target record in workspace?
- Labels:
-
User Interface (UI)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-14-2022 07:11 AM
Hello,
Have you reviewed this support article?
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0820726
Also, please make sure your UI Type is set to "All": https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0827632
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2022 10:28 PM
Hi Allen,
We have tried KB0820726, but looks like it works only for service catalog tables (sc_task and sc_req_item). We are trying to make the variables read-only for a record producer where target table is not one of service catalog tables.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2022 05:23 AM
Hi Allen,
We have tried KB0820726, but looks like it works only for service catalog tables (sc_task and sc_req_item). We are trying to make the variables read-only for a record producer where target table is not one of service catalog tables.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2025 03:42 AM
I don't know if you've already found a solution, in any case you can create a Client Script on incident table (just an example), set the View to sow and paste the following code:
function onLoad() {
g_form.setVariablesReadOnly(true);
}