Make variables on the target record read-only in workspace

Akshaya Shetty2
Kilo Contributor

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?

5 REPLIES 5

Allen Andreas
Administrator
Administrator

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!

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.

Akshaya Shetty2
Kilo Contributor

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.

e_disanto
Tera Contributor

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); 
}