I need this UI Action button
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Create a UI Action for the child_incident related list. When clicked, this UI Action should filter the related list to display only child incidents where the category is hardware.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @TanujB,
We can create this kind of UI action like:
Navigate to System Definition > UI Actions and click New.
Configure the UI Action form with the following values:
Table: Incident (incident)
Active: Checked
Show insert / Show update: Unchecked
Client: Unchecked (this will be a server-side script)
List banner button: Checked
Condition: current.getTableName() == 'incident'
Script:
// Get the sys_id of the parent incident
var parentId = current.getUniqueValue();
// Build the encoded query for the child incidents
var query = 'parent_incident=' + parentId + '^category=hardware';
// Construct the URL for the incident list with the new query
var url = 'incident_list.do?sysparm_query=' + query;
// Redirect the user to the filtered list
action.setRedirectURL(url);
Now, when you view an incident record and look at the "Child Incidents" related list, you will see a button (e.g., "Show Hardware Children") that, when clicked, will refresh the list to show only the child incidents with the "Hardware" category.
Hope this helps!
Thanks & Regards,
Muhammad Iftikhar
If my response helped, please mark it as the accepted solution so others can benefit as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
you cannot apply filter to related list on click of UI action.
You can use client side UI action and use GlideDialogWindow to show UI page and that will show child incidents where category is hardware
GlideDialogWindow: Advanced Popups Using UI Pages
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