- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2025 08:34 AM
In my PDI script Include is not running, while i verified in background script the code is working fine, Created script include and added script include in on change client script, the script include itself not working in my PDI, may i know the reason behind this
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2025 09:28 AM
@sarika ponnagan Try this
var Ifuserismanager = Class.create();
Ifuserismanager.prototype = Object.extendsObject(AbstractAjaxProcessor, {
isUserManager: function() {
gs.log("checking the manager");
var userId = this.getParameter('sysparm_user_sys_id');
var grReportee = new GlideRecord('sys_user');
grReportee.addQuery('manager', userId);
grReportee.setLimit(1);
grReportee.query();
if (grReportee.next()) {
gs.log("user is manager");
return true;
}
gs.log("user is not a manager");
return false;
},
type: 'Ifuserismanager'
});
✔️ If this solves your issue, please mark it as Correct.
✔️ If you found it helpful, please mark it as Helpful.
—
Shubham Jain
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2025 08:51 AM
So GlideAjax is not working.
Things to check
1) script include and client script are in same scope
2) script include is client callable
3) you are following correct GlideAjax syntax
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2025 08:51 AM
Hi @sarika ponnagan ,
Try to save your script include again and see at top you are getting message - Script include inserted. Then try again. If still nmot working, share screenshots.
Regards,
Nikhil Bajaj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2025 08:54 AM
@sarika ponnagan Is only specific Script Include is not working or None of SI is not working?
✔️ If this solves your issue, please mark it as Correct.
✔️ If you found it helpful, please mark it as Helpful.
—
Shubham Jain
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2025 09:01 AM
Same thing i did for on change client script for incident, Its not worked.
My criteria here is in catalog item in user reference selection field, when selected user is a manager for anyone, then its should show the popup, For this use case i tried like below mentioned screenshots, with using script include and catalog client script