var arrayUtil = new global.ArrayUtil() not working

KARAN24
Tera Contributor

Hi ,

Why  var arrayUtil = new global.ArrayUtil(); is not working in client script in scoped application.

 

Thanks,

karan

2 REPLIES 2

Weird
Mega Sage

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()

mcconnellsj
Kilo Sage

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.