Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Getting the error onload of EC ' ApprovalDelegationUtil undefined, maybe missing global qualifier'

Divya Patel3
Tera Contributor

Hello All,
Please help me to sort this issue, when I'm loading the EC Homepage with admin role it is working as expected, but when non-admin user is loading the page, they are facing as issue getting as error 'ApprovalDelegationUtil undefined, maybe missing global qualifier' and page behave also getting changed.
I've checked the ApprovalDelegationUtil script include, and other configuration (To-Do configuration), checked the cross scope privileges as well. all are in the place, nothing is manually updated.
Please see attached screenshot where I'm getting an error. 

DivyaPatel3_0-1747984190686.png

 

9 REPLIES 9

@Divya Patel3 

then if no script change then it's strange

 

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

shantanu_patel8
Mega Guru

Hi @Divya Patel3 

 

The script include "ApprovalDelegationUtil" is it defined in global Application?

 

Check from where ever it is getting called if its initialized like "new global.ApprovalDelegationUtil()"

 

Please mark the answer helpful clicking on 👍 and correct if it helps the issue. Happy scripting 🙂

 

-Shantanu

Hi Shantanu, 
Script include is in 'global' app. also checked from where new global.ApprovalDelegationUtil() called, but all are in place.

@Divya Patel3 

you didn't share what change did you make to the component?

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

Entity_01
Tera Contributor

Hello, I recently came across your post while fixing this issue myself.
If you cloned a widget from the global scope into a custom one, the declaration of the ApprovalDelegationUtil will need to be changed to a fully a qualified scope call now that it has left the same scope as the script include.

The change I made to mine was on line 15 of the server script 

data.isMine = new ApprovalDelegationUtil().isMyApproval(gr);

Changed to:

data.isMine = new global.ApprovalDelegationUtil().isMyApproval(gr);