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
‎06-10-2016 09:37 AM
Hi Eric,
As I mentioned you cannot make fields mandatory/readonly to the table which is not in your scope. I.e you'r in custom scope and try to modify the global fields.
However this operation will work if you create a custom table extended from task. Here this is working because custom table is in your own scope.
Please let me know if I am missing something or if you have additional questions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-10-2017 11:40 PM
Hi Pradeep,
We are kind of having same issue, could you please help us in resolving it.
Issue:
We have built a custom table(x_ct_request) in our scoped application, this table extends task table.We are using SM variable editor (Global scope) which picks all the variables from the record producers and displays them on (x_ct_request) table. Now we need to make the fields on this variable editor mandatory.
Approach:1:-
I have written an on display Business rule to get all the variable editor fields in g_scratchpad and then tried to make them read only using a client script.
but i am getting an error saying "ReadOnly true not set on field variables.check_status: cross-scope access denied.".
The table on which this business rule and client script are executing are in same application scope i.e. custom application scope.
Approach:2:-
I have written a simple client script statement " g_form.setVariablesReadOnly(true);" bu this doesnt work as well.
When i alert with g_form.getValue('variables.variable_name'); i get the correct value in alert but it doesn't set to readonly I get the same error ("ReadOnly true not set on field variables.check_status: cross-scope access denied.").
Please suggest me a correct approach if i am going wrong.
Waiting for your reply.
Thanks and Regards,
Zabeeulla.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-10-2018 04:46 PM
Hi
If you are still trying to achieve this, try the below:
g_form.getControl('field').readOnly = true;
Thanks
Shiva
Please hit Like, Helpful or Correct if this answer helps you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-21-2020 03:43 AM