Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

Give me "Server Javascript error 'window' is not defined" in UI Action using a client side script

khail
Kilo Contributor

I Have a UI Action then I checked the Client to do of course client side script but when I used the window it gives me that error in console log.

1 ACCEPTED SOLUTION

Brad Tilton
ServiceNow Employee

If this is in a scoped app, then a lot of APIs are blocked by default. You can read more about that here: Scoped Applications and Client Scripts: A Primer

You can enable access to APIs like window by adding a new a True/False system property in your application named glide.script.block.client.globals with the value false.

View solution in original post

1 REPLY 1

Brad Tilton
ServiceNow Employee

If this is in a scoped app, then a lot of APIs are blocked by default. You can read more about that here: Scoped Applications and Client Scripts: A Primer

You can enable access to APIs like window by adding a new a True/False system property in your application named glide.script.block.client.globals with the value false.