var arrayUtil = new global.ArrayUtil() not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2023 01:27 AM
Hi ,
Why var arrayUtil = new global.ArrayUtil(); is not working in client script in scoped application.
Thanks,
karan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2023 01:47 AM
ArrayUtil is serverside only.
You'd have to create a GlideAjax script include, send your data there and then inside the script include, use ArrayUtil()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2023 01:49 AM
If you look at the definition in developer, you will note type is "Server Global". Anything with Server cannot be used directly in a client script.
https://developer.servicenow.com/dev.do#!/reference/api/utah/server_legacy/c_ArrayUtilAPI
As @Weird suggests you need to employ GlideAjax which allows the call to server.
https://developer.servicenow.com/dev.do#!/reference/api/utah/client/c_GlideAjaxAPI
GlideAjax takes a bit of effort to understand if you are not familiar.