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

Thank you @JenniferRah , but still I got this error, after I've set the script include to be accessible  from other scopes

 

tpeleg_1-1734978636060.png

 

 

In your code, where you call ActionUtils, change it to say global.ActionUtils. By default, it searches in the current scope for the utility. You have to explicitly tell it to look in global since it's not in your scope.

Yeah, as I mentioned, i’m not calling it directly from the widget, just used the oob functionality, not sure how it’s called behind the scenes…

If you can't dig into the code behind the button, it might be best to put the button in the global scope.

tpeleg
Tera Expert

Thank you everyone!

In the end, I was able to solve it by comment out the OOTB call to ActionUtils in the table Submit ui action script:

 

tpeleg_0-1735055470496.png