- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2025 05:07 AM
Hi All,
There is a requirement, where I need to create a UI Action in computer table form which when clicked should show the list of devices from computer table itself which are allocated to the user who is selected in assigned to field in a popup window. I am able to get the list but it is getting open in new tab instead of pop up window. Below is the script:
Shivani
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2025 05:24 AM
you are using g_navigation and it will open new tab and not popup window
for popup window you need to use GlideDialogWindow
try this
function executeAction() {
var userSysId = g_form.getValue('assigned_to');
if (!userSysId) {
alert('Assigned to field is empty.');
return;
}
var w = new GlideDialogWindow('show_list');
w.setTitle('Computer List');
w.setPreference('table', 'cmdb_ci_computer_list');
w.setPreference('sysparm_view', 'default');
//Set the query for the list
var query = 'assigned_to=' + userSysId;
w.setPreference('sysparm_query', query);
//Open the popup
w.render();
}
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
06-13-2025 05:24 AM
you are using g_navigation and it will open new tab and not popup window
for popup window you need to use GlideDialogWindow
try this
function executeAction() {
var userSysId = g_form.getValue('assigned_to');
if (!userSysId) {
alert('Assigned to field is empty.');
return;
}
var w = new GlideDialogWindow('show_list');
w.setTitle('Computer List');
w.setPreference('table', 'cmdb_ci_computer_list');
w.setPreference('sysparm_view', 'default');
//Set the query for the list
var query = 'assigned_to=' + userSysId;
w.setPreference('sysparm_query', query);
//Open the popup
w.render();
}
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
06-15-2025 07:33 PM
Hope you are doing good.
Did my reply answer your question?
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
06-17-2025 12:24 AM
Hi Ankur,
Thanks for highlighting the mistake. It is now working as expected.
Regards,
Shivani