How to call a global script include from now-sdk?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2025 06:48 AM
Hi now-sdk community,
I struggle to complete the following task: calling a global script include from my now-sdk scopped application.
When the following snippet runs well in a bg script (executed from my application scope):
var test = new global.inboundAPILog().insertEventLog('x_frt_orangetmf697.inbound.api.event', null, "","");
The exact same script deployed through now-sdk will produce this error: "undefined is not a function".
Surprisingly, if I open the deployed sys_module in my browser, the global script include is well found, and I can navigate to it with control+click :
I haven't found any resources on this specific topic, does this speak to you?
Thanks a lot for your feedback,
Regards,
Anthony
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2025 07:15 AM
Hi @anthonydian,
please re-attach your screenshot using the clip icon, this is not visible due to the forum moderation (not your fault) so nobody can see it...
Debugging tips:
- check your script include is client callable: true
- check your custom app has not restricted access
Keep me updated on your progress
/* If my response wasn’t a total disaster ↙️ ⭐ drop a Kudos or Accept as Solution ✅ ↘️ Cheers! */
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2025 07:30 AM
Hello @GlideFather
Here you go 🙂
The "client_callable" checkbox was unticked, i just tested it and no luck, still getting the "undefined is not a function." error.
What surprises me is that the exact same code is working through background-script: this should exclude permissions issues from my point of view.
Thanks for your help!
Regards,
Anthony
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2025 07:41 AM
OK, thanks for checking this and what about the accessibility?
You said it was custom scope...
And for the background script, what scope have you there?
Also, calling global script include with the global in front of the name and function can be troublematic... if nothing else helps, you can try to remove "global." from "global.inboundAPILog()". But just guessing... it might be related to BRs only >>> KB0777628
/* If my response wasn’t a total disaster ↙️ ⭐ drop a Kudos or Accept as Solution ✅ ↘️ Cheers! */
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2025 07:42 AM
Hi @anthonydian ,
is the script include inboundAPILog accessible from all application scopes? if not please make it public
if this doesn't work please share the script includes screenshots and code
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya