Submit button pops up error alerts on a scoped app

tpeleg
Tera Expert

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:

 

 

tpeleg_0-1734965335673.png

 

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

tpeleg_1-1734965709055.png

 we still see error alerts, but different:

tpeleg_2-1734965795485.png

 

did someone faced this kind of issue? if yes, what would be the best approach to solve?

 

Thanks,

 

Tomer

14 REPLIES 14

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

-------------------------------------------------------------------------

Yeah, me either. And already tried what you suggested but still no luck…

 

Ankur Bawiskar
Tera Patron
Tera Patron

@tpeleg 

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.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Thank you @Ankur Bawiskar , I've tried to clone the ActionUtils in my scoped app, but now the errors shows different alerts.... 

tpeleg_0-1734972857295.png

 

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.