- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
script include :
This is how I call it in report, it is showing error
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
did you run your script include in background and you are getting result i.e. sysIds?
also Sandbox checkbox if not on Form, then from list make it true
Configuring Script sandbox property
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
your script include should be client callable then only it can be called from report filter condition
If you have created the Script Include in ServiceNow version "Washington" and above make sure, you have checked the "Sandbox enabled" Checkbox.
var BlankRequestChecker = Class.create();
BlankRequestChecker.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getBlankRequestList: function() {
var blankRequestSysIDs = [];
var req = new GlideRecord('sc_request');
req.addQuery('active', true);
req.query();
while (req.next()) {
var ritm = new GlideRecord('sc_req_item');
ritm.addQuery('request', req.sys_id);
ritm.query();
if (ritm.hasNext()) continue;
var approval = new GlideRecord('sysapproval_approver');
approval.addQuery('sysapproval', req.sys_id);
approval.addQuery('state', 'requested');
approval.query();
if (approval.hasNext()) continue;
var task = new GlideRecord('sc_task');
task.addQuery('request', req.sys_id);
task.addQuery('active', true);
task.query();
if (task.hasNext()) continue;
blankRequestSysIDs.push(req.sys_id.toString());
}
return blankRequestSysIDs;
},
type: 'BlankRequestChecker'
});
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
its already client callable still getting the error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
client callable script include should not have initialize() method
Please remove that and copy my script
Also ensure about this point
If you have created the Script Include in ServiceNow version "Washington" and above make sure, you have checked the "Sandbox enabled" Checkbox.
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
I have used your script still getting the same error and I am using Yokhlama version there is not option for sandbox.
