OOB how variable editor is set to read only for Record Producer?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2022 04:05 AM
I come across two Client scripts: "Variable Editor Readonly" for sc_req_item and sc_task Table. However there is nothing for Record Producers. Does anybody knows OOB how variable editor are set to read only for record Producers?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2022 04:10 AM
Those Client Scripts are disabled OOB.
You can make your variables read-only through Catalog UI Policies, or by copying those client scripts and changing it to the table for your given record producer.
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2022 04:13 AM
I hv enabled the two Client scripts and it worked fine for RITM and TASK. For incident" g_form.setVariablesReadOnly(true);" this function doesn't work

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2022 04:50 AM
Hi Rajat,
We do not have such functionality in record producer. Service catalog has variables which can be hidden by this client script.
For record producer eg Incident, It should follow the normal process of making field read only via client script or UI Policies or ACLs.
Incident does not have variables but has fields hence g_form.setVariablesReadOnly(true); will not work.
Regards,
Deepankar Mathur

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2022 04:55 AM
Refer servicenow proposed workaround for making fields read only - https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0752560
Regards,
Deepankar Mathur