Client Script calling scoped Script Include via GlideAjax works for admin but not for other users
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thursday
Hi everyone,
I have a Client Callable Script Include in a custom scope (x_2060759_base_m_0) called BaseValidatorUtils, which extends AbstractAjaxProcessor. It performs duplicate checks on a form using GlideAjax.
Setup details:
- The Script Include has "Accessible from" set to All Application Scopes
- The Client Script is also set to All Application Scopes
- The non-admin user has read access to the target table
The issue: When I fill out the form as an admin, the validation works perfectly. When I impersonate a non-admin user, the validation silently fails.
After some investigation, I suspect the problem is that in my Client Script I am instantiating GlideAjax without the full scoped name:
What I had: new GlideAjax('BaseValidatorUtils') What I think it should be: new GlideAjax('x_2060759_base_m_0.BaseValidatorUtils')
Questions:
- Is it correct that admins can resolve a scoped Script Include without the scope prefix, while regular users cannot?
- Should the scope prefix always be used when calling a scoped Script Include via GlideAjax from a Client Script, even when both are set to All Application Scopes?
- Are there any other common pitfalls when calling scoped Script Includes from Client Scripts for non-admin users?
Any help is appreciated. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thursday
Things to do
1) always use complete API name in GlideAjax call although it's not required when both are in same scope
2) the client callable script include will be having an execute ACL, ensure there snc_internal role is given
May be the system is not allowing non-admins to call script include
Non-admin means which user?
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader