Accessing global script include from client side scoped application error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi, I have created a global scoped application with a Script Include as shown in the screenshot. I tried to call this script include from onsubmit client script of another scoped application (see script pasted below) but the platform generates error " When targeting a global resource, only ServiceNow authored scopes are allowed as sources ". Does it mean, I can't call script includes from a global scoped application that I have created? I did create a record in "Application cross-scope access" table to allow execution of script include from scope application. Sorry, I am new to ServiceNow and learning at the moment.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
6 hours ago
Greetings @sohailsarwar,
I believe you have a mismatch in scopes within your Script Include between your Application field and the API name. The expected syntax of the API name is listed below. Your Script Include is showing that it is in the "CustomUtils" application scope, however, your API name shows "global.UtilsString".
<application_scope_prefix>.<script_include_name>
Can you click the preview icon to the immediate right of the Application field and look for the Scope value. It will be in some sort of format with underscores instead of spaces. I'll include a link to Script Includes from ServiceNow documentation. I hope this helps!
