Calling Script Include from Record Producer Script Stopped Working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
I have 5 record producers and all of them call a different function within a script include from the 'script' portion of the record producer. E.g.:
new scriptInclude().runScript();
One of the record producers is no longer able to call a script include. It won't run the original script nor will it run a script from a different script include. No idea what's happening. Have made no changes to the Script Include. Anyone experience something similar or know what might be going on?
p.s.: I have tried writing the above script in numerous different ways including:
var test = new scriptInclude();
test.runScript();
It doesn't fix it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @ekuklinski ,
1) What is scope of record producer and script include.
2) if both are same scope then are there any lines of code written that causing errors before your script include execution.
3) try to use log statements or script debugging.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
so it was working fine earlier and stopped now?
did you recently upgrade?
both record producer and script include are in same scope?
share record producer script and script include scripts here along with screenshots.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @ekuklinski ,
Please verify the below steps:
> Ensure that both the Record Producer script and the Script Include are in the same application scope. If the Script Include exists in a different scope, especially a scoped app, it may not be accessible from your Record Producer.
> If you're invoking the Script Include server-side (from the Record Producer script), it does not need to be "Client Callable", But if there's any GlideAjax or client-side invocation, it must be a Client Callable Script Include and declared global if needed.
>Double-check your Script Include syntax
> Even for client-callable Script Includes, ACLs can block execution for certain users. If your Record Producer runs under a user without adequate access, the Script Include may fail.
> Script Includes located in a scoped application sometimes fail to execute correctly when called from Record Producers, especially in the Service Portal or Catalog context. A known workaround is to move the Script Include to the Global scope, where access tends to be more permissive.
If you found my response helpful, please mark it as ‘Accept as Solution’ and ‘Helpful’. This helps other community members find the right answer more easily and supports the community.
Kaushal Kumar Jha - ServiceNow Consultant - Lets connect on Linkedin: https://www.linkedin.com/in/kaushalkrjha/