Making variables read only on scoped application
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2016 06:37 AM
Hello all,
In our application, we are using variables that are extended from the question_answer table in our Incident form. What I am trying to do is hide the variable based on the status of our Incident. I have an onLoad client script that runs and calls the variable name (e.g. g_form.setDisplay('variables.confirm_support_udf_quest, false)), but it is not responding. I have also tried, g_form.setReadOnly() for the variables, and that has not worked either. I can verify that using g_form.setValue and g_form.getValue works though. Has anyone been able to have it so that variables in a scoped application are set to read-only within a scoped application? Any help would be appreciated, thanks!
Eric

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2016 06:53 AM
Hi Eric,
Scoped applications cannot change the Mandatory, ReadOnly, Display, or Disabled status of fields outside of their scope- with one interesting exception. If your Client Script runs on a table in your own application, and that table extends a table from another scope, the fields you inherit from that base table are considered in-scope when they are displayed on your form.
Creation Restrictions Across Application Scopes - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-08-2016 12:41 PM
Hi Pradeep,
Thanks for getting back to me. Are there any future plans to possible allow this though? I understand not wanting to control other fields that are not part of your table, but I thought maybe it would be a special case for variables since they are a little more customizable and can be seen on many tables.
Eric

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-08-2016 12:45 PM
Hi Eric,
Thanks for the update. I would request you to create Enhancement request on HI with your use case.
Enhancement requests: Tell us how you would improve the ServiceNow product
Please mark this post and close the thread if your question is answered
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-10-2016 09:32 AM
Hi Pradeep,
I did have a follow-up question that you could possibly answer. I had mentioned before that with the variables I'm putting into my scoped application table that I can use g_form.setValue/g_form.getValue(), but I'm not able to make them mandatory/read-only/disabled. Why is it that I can use some functionality with the variables, but not the others? Not sure why there would be a difference. Let me know when you can, thanks again!
Eric