Scripted Lists for my request not displaying data or counter on menu item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2023 10:29 AM
Hello,
I have created a scripted list menu item for my requests. The issue is that the value and the counter is not displaying at all. I do get a list with the number of records but I cannot see the data just a blank list and the counter does not show up.
The twelve records are there, if I hover the mouse through the list I can see the twelve spaces but the values are not displaying. Also, I am expecting a counter next to Requests with a number 12. How can I fix this.
This is the code I used:
var max = 30;
var t = data;
t.items = [];
var u = gs.getUser().getID();
//Use record watchers to tell header when to update dropdown counts
t.record_watchers = [];
t.record_watchers.push({
'table': 'sn_hr_core_case',
'filter': 'active=true^subject_person=' + u
});
var z = new GlideRecord('sn_hr_core_case');
z.addQuery('subject_person', gs.getUserID());
z.addQuery('active', true);
z.orderByDesc('sys_updated_on');
z.setLimit(max);
z.query();
while (z.next()) {
var a = {};
$sp.getRecordValues(a, z, 'short_description,sys_id,number,sys_updated_on');
if (z.short_description.nil())
a.short_description = "(No description)";
a.__table = z.getTableName();
a.type = 'record';
t.items.push(a);
}
t.items = t.items.slice(0, max); // only want first 30
t.count = t.items.length;
var link = {
title: gs.getMessage('View all evidences'),
type: 'link',
href: '?id=my_requests',
items: []
};
t.items.unshift(link); // put 'View all evidences' first
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2023 11:30 AM
Hi @rocio2 ,
I notice that the records that are being watched are on the sn_hr_core_case table. If you created this item menu list outside the HR Core scope, it may be a Restricted Caller Access that is blocking the count.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2023 05:28 AM
Hey Chris,
I did try to create the menu item in HR Core scope but that made no difference. The weird thing is that I am experiencing the issue with the ESC portal because if I use that same menu item in the SP portal then the code works. I honestly dont know what is wrong. I even went to the restricted caller access module to see if there was anything I needed to allow and there is nothing that has been requested access.
Thanks,
Rocio

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2025 12:22 PM
Have you found a solution to this? I'm experiencing the same problem. The same menu on sp works just fine, but not on esc.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2025 01:27 PM
For me, I literally copid @rocio2 's code posted above without changing anything, pasted it into a menu item record in the HR Core application scope and it worked.