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.

Calling a script include from workspace client script

Patrick Tipps1
Tera Contributor

Hi all,

I have a story requirement to modify the "Close Complete" UI action on the wm_order table. The button works the way it's intended in the native UI, but not the workspace. I can't seem to call SMTask() from the workspace client script. Can someone help me figure out what I'm doing wrong?

PatrickTipps1_0-1761322295117.png

 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Patrick Tipps1 

that line at line 7 is server side and won't work in client side.

you can use GlideAjax and then invoke that line in script include

How to use UI Actions in Workspaces 

Note: if you are in scoped app then that script include should be made Accessible from All Scopes, then only Ajax works

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

View solution in original post

1 REPLY 1

Ankur Bawiskar
Tera Patron
Tera Patron

@Patrick Tipps1 

that line at line 7 is server side and won't work in client side.

you can use GlideAjax and then invoke that line in script include

How to use UI Actions in Workspaces 

Note: if you are in scoped app then that script include should be made Accessible from All Scopes, then only Ajax works

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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