
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2022 02:07 AM
Hi,
I'm encountering this issue "Mandatory false not set on field vendor: cross-scope access denied"
I have created a scope app table that extends to application table where i'm making use of the vendor field.
But when i try to make the field mandatory false the error message shows in the logs "Mandatory false not set on field vendor: cross-scope access denied".
What kind of cross scope access do we need for this one?
Thanks,
Tads
Solved! Go to Solution.
- Labels:
-
Personal Developer Instance

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2022 09:30 PM
Hi Everyone,
It seems this is an existing problem in ServiceNow
Please see related Now Support Article:
Client scripts on a scoped table in cmdb hierarchy with g_form methods like "setMandatory, setDispla...
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2022 03:25 PM
Hi
Is your issue resolved?
Feel free to mark correct, if your issue has been resolved, so it ends up in solved queue.
Will be helpful for others looking for the similar query.
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-23-2022 07:01 PM
Hi Aman,
I am still facing this issue.
Couple of observations -
1. Referred KB article applies to Global TPP tables like cmdb_ci. However I am stumbling upon this red error box issue only in Tokyo with task table as well that is not TPP. This issue for task table is not present in pre Tokyo version.
2. In browser developer console, cross scope error gets logged for pre Tokyo version as well. However it does not show red error box. In Tokyo it does.
3. We have complex Heirarchy of scopped applications. Converting all the client scripts (those performing setMandatory() etc) to UI policy action is practically impossible.
4. In Tokyo, Order of execution of inherited Client script is - grandparent first then parent and child at last. This is different than San Diego where its child first then grandparent and parent at last. This is causing race condition on our business logic implementation.
If someone has already found a solution for it, please do share.
Also let me know if there a switch (like sys_prop) to revert back to pre-Tokyo behavior for those who cannot sustain with these newly introduced changes.
Thanks in advance.
Vinay Verma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2023 11:28 PM
Hi Vinay,
Did you got any solution apart from converting Client Scripts in to UI Policies?
Thanks,
Rajat

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2022 09:30 PM
Hi Everyone,
It seems this is an existing problem in ServiceNow
Please see related Now Support Article:
Client scripts on a scoped table in cmdb hierarchy with g_form methods like "setMandatory, setDispla...
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