Skip to page contentSkip to chat
ServiceNow support
    • Community
      Ask questions, give advice, and connect with fellow ServiceNow professionals.
      Developer
      Build, test, and deploy applications
      Documentation
      Find detailed information about ServiceNow products, apps, features, and releases.
      Impact
      Accelerate ROI and amplify your expertise.
      Learning
      Build skills with instructor-led and online training.
      Partner
      Grow your business with promotions, news, and marketing tools
      ServiceNow
      Learn about ServiceNow products & solutions.
      Store
      Download certified apps and integrations that complement ServiceNow.
      Support
      Manage your instances, access self-help, and get technical support.
Client scripts on a scoped table in cmdb hierarchy with g_form methods like "setMandatory, setDisplay, setReadOnly, setDisabled" on global TPP fields do not work - Known Error
  • >
  • Knowledge Base
  • >
  • Known Error (Knowledge Base)
  • >
  • Client scripts on a scoped table in cmdb hierarchy with g_form methods like "setMandatory, setDisplay, setReadOnly, setDisabled" on global TPP fields do not work
KB0813148

Client scripts on a scoped table in cmdb hierarchy with g_form methods like "setMandatory, setDisplay, setReadOnly, setDisabled" on global TPP fields do not work


3693 Views Last updated : Apr 8, 2024 public Copy Permalink
KB Summary by Now Assist

Description

Error "cross-scope access denied" thrown from scoped client scripts using g_form methods on global TPP fields.

Steps to Reproduce

1. Create a new or open an existing scoped application in Studio
2. Create a new scoped table extending cmdb_ci
3. Add an on-load client script as below on the scoped table to set a global field like "install_status" as Mandatory or read only, etc.

function onLoad() {
g_form.setMandatory('install_status', false);
g_form.setDisplay('install_status',true);
g_form.setReadOnly('install_status', false);
g_form.setDisabled('install_status', false);
}

4. Navigate to the list view of the table from step 2 and click New.

Result: The script does not work and below messages are seen in the console when the form loads

Mandatory false not set on field install_status: cross-scope access denied.
Display true not set on field install_status: cross-scope access denied.
ReadOnly false not set on field install_status: cross-scope access denied.
Disabled false not set on field install_status: cross-scope access denied.

Workaround

Use UI Policy and add a UI Policy Action to perform similar actions on the field.


Related Problem: PRB1384434

The world works with ServiceNow.

Sign in for more! There's more content available only to authenticated users Sign in for more!
Did this KB article help you?
Did this KB article help you?

How would you rate your Now Support digital experience?

*

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

What can we improve? Please select all that apply.

What are we doing well? Please select all that apply.

Tell us more

*

Do you expect a response from this feedback?

  • Terms and conditions
  • Privacy statement
  • GDPR
  • Cookie policy
  • © 2025 ServiceNow. All rights reserved.