How to hide "View all request" dropdown on menu items in Service Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
13 hours ago
I am able to display the count by using out of box menu item script. How to hide the "view all items". I want to directly go to the list page not the dropdown. how to hide that ? I tried removing that part of code but that doesn't work !
This is the code :
var max = 30;
var t = data;
t.items = [];
t.count = 0;
var currentUserEmail = gs.getUser().getEmail();
// record watchers: listen for changes to this custom table
t.record_watchers = [];
t.record_watchers.push({
'table': 'x_1097288_hacktaho_hackathon_team',
'filter': 'external_user_email_idsLIKE' + currentUserEmail
});
// Query hackathon teams where user is involved
var gr = new GlideRecord('x_1097288_hacktaho_hackathon_team');
gr.addQuery('external_user_email_ids', 'CONTAINS', currentUserEmail);
gr.orderByDesc('sys_updated_on');
gr.setLimit(max);
gr.query();
// Add "View All My Teams" link
var link = {};
link.title = gs.getMessage('View all my Hackathon Teams');
link.type = 'link';
link.href = '?id=my_team_requests'; // <-- create a page for this or direct to list view
link.items = [];
t.items.push(link);
while (gr.next()) {
var a = {};
a.team_name = gr.getValue('team_name');
a.hackathon = gr.hackathon.getDisplayValue();
a.external_users = gr.getValue('external_user_email_ids');
$sp.getRecordValues(a, gr, 'sys_id,sys_updated_on');
a.type = 'hackathon_team';
t.items.push(a);
t.count++;
}
// Badge count for header
if (t.count == 1)
data.badgeHint = gs.getMessage('{0} team found', [''+t.count]);
else
data.badgeHint = gs.getMessage('{0} teams found', [''+t.count]);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
13 hours ago
if there are more records to show it won't be a good UI experience to show all the records.
Did you inform customer about this?
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
13 hours ago
@Ankur Bawiskar
We don't need to show all records just like a normal menu
1. Show count.
2. When clicking directly goes to tickets list page.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12 hours ago
which portal is this?
esc or sp?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12 hours ago
It is a custom Service Portal.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12 hours ago
check this
Replicating adding a scripted list menu item in Employee Center
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