Submit button pops up error alerts on a scoped app
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2024 06:59 AM
Hi experts,
we cloned the ootb form widget to a scoped app and when using the submit button on a new record (save button) it's inserts a new record to a table but pops up some error alerts:
here is the HTML code (same as OOB) :
<button ng-if="getPrimaryAction()" type="submit" ng-click="triggerUIAction(getPrimaryAction())" ng-disabled="submitting" class="btn btn-primary action-btn pull-right" gsft_id="{{::getPrimaryAction().sys_id ? getPrimaryAction().sys_id : ''}}">${Submit}</button>
client and server scripts are same as OOB as well.
when using same button to update existing record, there are no alerts.
I believe it's a scoped app issue, so I've tried to change the ActionUtil script include to be accssible from all scopes
we still see error alerts, but different:
did someone faced this kind of issue? if yes, what would be the best approach to solve?
Thanks,
Tomer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2024 09:09 PM
Hi @tpeleg ,
I have not figure this out from where its calling script include 🙂
Do one thing, create new script include in your scop and copy the entire code from global.
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2024 09:16 PM
Yeah, me either. And already tried what you suggested but still no luck…
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2024 07:41 AM
why you didn't create the script include in same scope?
the error clearly says it requires global quantifier
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
12-23-2024 08:54 AM
Thank you @Ankur Bawiskar , I've tried to clone the ActionUtils in my scoped app, but now the errors shows different alerts....

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2024 09:31 AM
ActionUtils is a script include in the Global Scope that is not usable from other scopes. You will either need to modify that script include to be accessible from other scopes or change your button to be in Global.