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