The CreatorCon Call for Content is officially open! Get started here.

Creating a Dialog Window to emulate Reference Field Lookup Window

alijubran
Kilo Expert

I am working on a script that will pop up a window and allow the user to select an Assignment Group when the Assigned To user is selected and Assignment Group is empty. The popup window will display only groups that the Assigned To user is a member of.

I am able to get all of that working, but i am using the following in my onChange client script.

setTimeout(function(){$('lookup.incident.assignment_group').click()}, 500);

This essentially forces a mouse click on the Assignment Group lookup button and by using the backfill assignment   (Reference Qualifiers - ServiceNow Wiki ) ref qualifier , only groups that the user is a member of displays....

My inquiry is to see if anyone can suggest a better way of displaying the available groups in a popup and allow the user to select from the Assigned To User's groups. It currently pops the window up in the top left hand corner and still shows the + buttons in the group hierarchy to expand and show users. Ideally I would only want the Group name.

I was thinking Dialog Window but haven seen a way to create a clickable ref list.

1 ACCEPTED SOLUTION

bernyalvarado
Mega Sage

Hi Ali,



One option that you have is to use a GlideOverlay which displays a UI page from which you can render a table with the various groups the assigned to belongs to and make each group name clickable so that when's is clicked a hidden variable is set which is the one that's going to be used to set the assignment_group field.



Thanks,


Berny


View solution in original post

5 REPLIES 5

bernyalvarado
Mega Sage

Hi Ali,



One option that you have is to use a GlideOverlay which displays a UI page from which you can render a table with the various groups the assigned to belongs to and make each group name clickable so that when's is clicked a hidden variable is set which is the one that's going to be used to set the assignment_group field.



Thanks,


Berny


Your's is probably the right solution but I found limited documentation on the GlideOverlay, therefore I went with the GlideDialogWindow


Kalaiarasan Pus
Giga Sage

But can't you just do the same by adding a reference qualifier to the assignment group field?



This would keep the solution in alignment with out of the box feature and would not give you any trouble during upgrades as well..


The ref qualifier was already added per the requirements and that part works great; it was the AUTOMATIC popup that I was attempting to solve. I realize now that the automatic popup onChange wasn't really clear in my initial inquiry.