- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2023 01:23 AM - edited ‎12-07-2023 02:25 AM
Hi All,
Can anyone please us on the below script:
We wrote one script include and client script to hide the Related list, If the user/manager don't have any direct reporters. But some reasons it's not wokring for us, can anyone please check and let us know where we went wrong.
Script include:
return userCount++;
Client script:
}
Advance thanks.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2023 01:43 AM
Sorry my bad,
Please update script include like this:
var getManagerDirectReports = Class.create();
getManagerDirectReports.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getActiveUsers: function(managerSysID) {
var manId = this.getParameter('manager_id');
var usr = new GlideRecord('sys_user');
usr.addQuery('manager', manId); // updated query
usr.query();
return usr.getRowCount();
},
type: 'getManagerDirectReports'
});
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2023 01:29 AM
Can you correct this in script include:
return userCount; //return only the variable do not add ++
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2023 01:38 AM - edited ‎12-07-2023 01:42 AM
HI Shamma,
Thanks for the response.
We tried your suggestion but in alert we're getting null.
Advance thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2023 01:44 AM
try this pls:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2023 01:44 AM
Right click on list. Configure -> List Layout check the REL sys_id from there.
Hope it helps.
Regards,
Shamma