how to use glideajax in scoped application?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2023 01:36 AM
I tried glideajax in scoped application by using getXML i am trying to assign value to a field it is not assigning.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2023 05:03 AM
Hi @Narayana Swamy ,
can u put an alert on answer variable in client script n check whether u receiving anything or not also at the beginning of the script include after the function is called put a log n check if that is getting printed.
Thanks,
Danish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2023 07:43 AM
I checked by using alert the date is coming from script include but not assigning date value to the field.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2023 05:26 AM
@Narayana Swamy Could you please confirm in which scope your script include is defined. Is it in Global scope or application scope?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2023 07:43 AM
It was in application scope

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2023 10:00 AM
@Narayana Swamy Please update your script include code as follows and your client script will start working.
var DOMSPOAjaxUtils = Class.create();
DOMSPOAjaxUtils.prototype = Object.extendsObject(AbstractAjaxProcessor, {
currentDateTime: function() {
var glideRecord = new GlideDate();
var gDate = glideRecord.getByFormat('MM/dd/YYYY hh:mm:ss a');
gs.info('Hi3242342'+gDate);
return gDate;
},
type: 'DOMSPOAjaxUtils'
});
gs.log is not supported in the scoped application, your script is crashing due to the same reason and you were not able to see output due to this issue. I replaced gs.log with gs.info, hope this fixes your issue.
For more information this topic, please refer to the support article https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0788208
Hope this helps.