How to show Groups data in Dialog Window/GlideModal in List View.

Mahendra RC
Mega Sage

Hi All,

I have a requirement where I need to show the groups in the Dialog window/GlideModal when user clicks on the '4 groups' shown in the below diagram.

link.PNG

I have stored the data for the groups on form in 1 field. So Now I want to show these 4 groups in List View (something similar to the one shown below) in Dialog window/GlideModal When user click on '4 groups' and I am implementing this on table form and not in UI pages, Widgets etc.

Groups data.PNG

This is just for reference. I want to show the groups like this way.

Could anyone please suggest me how can I do this.

Thanks in Advance,

Mahendra

1 ACCEPTED SOLUTION

Mahendra RC
Mega Sage

This issue is resolved using the below code in UI Macro in <script> tag:

function groupsDetail(targetGroups) {
try {
var title = 'Showing Group data';
var query = 'sys_idIN' + targetGroups;
var gdw = new GlideModal('show_list');
gdw.setTitle(title);
gdw.setSize(450);
gdw.setPreference('table', 'sys_user_group_list');
gdw.setPreference('sysparm_query', query);
gdw.setPreference('sysparm_view', 'athoc_alert_group');
gdw.setPreference('sysparm_action', false);
gdw.setPreference('title', 'A New Title');
gdw.render();
} catch (e) {
jslog('error showing related list');
jslog(e);
}
}

 

Marking this answer as correct so that it could be helpful to other.

View solution in original post

1 REPLY 1

Mahendra RC
Mega Sage

This issue is resolved using the below code in UI Macro in <script> tag:

function groupsDetail(targetGroups) {
try {
var title = 'Showing Group data';
var query = 'sys_idIN' + targetGroups;
var gdw = new GlideModal('show_list');
gdw.setTitle(title);
gdw.setSize(450);
gdw.setPreference('table', 'sys_user_group_list');
gdw.setPreference('sysparm_query', query);
gdw.setPreference('sysparm_view', 'athoc_alert_group');
gdw.setPreference('sysparm_action', false);
gdw.setPreference('title', 'A New Title');
gdw.render();
} catch (e) {
jslog('error showing related list');
jslog(e);
}
}

 

Marking this answer as correct so that it could be helpful to other.