- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2023 06:21 AM - edited 05-03-2023 10:03 PM
Team,
I want to check what came in logs in script include
Script Include:
var itemUtils = Class.create();
itemUtils.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getEntitlements: function() {
var code = this.getParameter('sysparm_code');
var result = [];
var entGr = new GlideRecord('u_code_entitlements'); //Custom 'Organization Job Code Entitlements' Table
entGr.addQuery('u_job_code', code.toString()); //'u_job_code' is Reference type field; Reference from custom 'Organization Job Code Entitlements' table
entGr.addQuery('u_entitlement_active', 'true'); //True/False type field
entGr.query();
while (entGr.next()) {
result.push(entGr.sys_id.toString());
}
return result.toString();
},
type: 'itemUtils'
});
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2023 06:46 AM
Please add logs as highlighted in below script and trace these logs in
Filter Navigator <-> system logs
var itemUtils = Class.create();
itemUtils.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getEntitlements: function() {
var code = this.getParameter('sysparm_code');
gs.info("Risabh: 1" + this.getParameter('sysparm_code'));
var result = [];
var entGr = new GlideRecord('u_code_entitlements'); //Custom 'Organization Job Code Entitlements' Table
entGr.addQuery('u_job_code', code.toString()); //'u_job_code' is Reference type field; Reference from custom 'Organization Job Code Entitlements' table
entGr.addQuery('u_entitlement_active', 'true'); //True/False type field
entGr.query();
while (entGr.next()) {
result.push(entGr.sys_id.toString());
}
gs.info("Risabh: 2" + result);
return result.toString();
},
type: 'itemUtils'
});
If my answer solved your issue, please mark my answer as ✅ Correct & 👍Helpful based on the Impact.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2023 06:25 AM
Hi @rishabh31 ,
Please use this article : https://www.servicenow.com/community/developer-articles/using-the-script-debugger-for-client-callabl...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2023 06:46 AM
Please add logs as highlighted in below script and trace these logs in
Filter Navigator <-> system logs
var itemUtils = Class.create();
itemUtils.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getEntitlements: function() {
var code = this.getParameter('sysparm_code');
gs.info("Risabh: 1" + this.getParameter('sysparm_code'));
var result = [];
var entGr = new GlideRecord('u_code_entitlements'); //Custom 'Organization Job Code Entitlements' Table
entGr.addQuery('u_job_code', code.toString()); //'u_job_code' is Reference type field; Reference from custom 'Organization Job Code Entitlements' table
entGr.addQuery('u_entitlement_active', 'true'); //True/False type field
entGr.query();
while (entGr.next()) {
result.push(entGr.sys_id.toString());
}
gs.info("Risabh: 2" + result);
return result.toString();
},
type: 'itemUtils'
});
If my answer solved your issue, please mark my answer as ✅ Correct & 👍Helpful based on the Impact.