- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2016 03:50 AM
Just remove the global. Refer to the modified script below:
var counttest = Class.create();
counttest.prototype = Object.extendsObject(AbstractAjaxProcessor, {
counttest: function() {
gs.info ('AAAA:This script is executing');
var gr = new GlideRecord('incident');
gr.query();
if(gr.next())
{ //Added this one
gs.info("info");
var datedif = gs.dateDiff(gr.sys_created_on,gs.nowDateTime(), false);
gs.info('AAAA:'+datedif);
return datedif;
}
},
type: 'counttest'
});
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2016 12:09 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2016 12:22 AM
which servicenow version are you using?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2016 02:38 AM
i am using Helsinki Version of Servicenow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2016 08:12 PM
You might also want to check this article out: One of the best breakdowns of client side GlideRecord and GlideAjax ServiceNow Pro Tips — GlideRecord & GlideAjax: Client-Side Vs. Server-Side