How to filter the user look up list in a UI page depending on the assignment groups of the selected records?

Arpan6
Giga Guru

I have a requirement to set the 'Assigned to' field value of the incident list view using a dialogwindow. For this I have set up a UI page and a list choice UI action. Now I want to put a reference qualifier to the user lookup field so that the filter contains only those user record who are the members of the assignment groups of the selected records.i.e. same lookup list as the list edit of the 'Assigned to' field.   The UI page, and the ui action are as below

----------------------------------------------------------------------------------------------------------------------

UI Page:

Name : multiple_assignment

HTML:

<?xml version="1.0" encoding="utf-8" ?>

<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">

<g:ui_form>  

  <g:evaluate>  

  var currentTable = RP.getWindowProperties().get('current_table') || '';  

  var sysIdList = RP.getWindowProperties().get('sys_id_list') || '';  

  </g:evaluate>  

 

  <input type="hidden" name="current_table" value="$[currentTable]" />  

  <input type="hidden" name="sys_id_list" value="$[sysIdList]" />

<span>Assign the selected tickets to a member of your group</span><br/>

<ul>

<li>You can only assign the records in your queue</li>

</ul>

<table width="580">

<tr>

                <td nowrap="true"> ${gs.getMessage('Assignee')}: </td>

                      <td>

                            <g:ui_reference name ="cuser"   table="sys_user" />

                      </td>

          </tr>

<tr id="dialogbuttons">

                  <td align="right" colspan="2">

              <g:dialog_buttons_ok_cancel ok="return onSubmit();" cancel="return onCancel();"/>

          </td>

          </tr>

</table>

</g:ui_form>

</j:jelly>

Processing Script :

addAssignee();  

 

function addAssignee() {  

  var choice = new GlideRecord(current_table);  

    if (sys_id_list) {  

  var selectedRecords = sys_id_list.split(',');  

  choice.addQuery('sys_id', selectedRecords);  

  }  

  choice.query();  

  while (choice.next()) {  

  gs.addInfoMessage(choice.value);  

  choice.assigned_to = cuser;  

  choice.update();  

  }  

  refresh();  

}  

function refresh() {  

  var urlOnStack = GlideSession.get().getStack().bottom();  

  response.sendRedirect(urlOnStack);  

}  

----------------------------------------------------------------------------------------------------------------------

UI Action:

Name : Add Assignee

Onclick: showAssigneeDlg()

Script :

function showAssigneeDlg(){

var gDialog = new GlideDialogWindow('multiple_assignment');

gDialog.setPreference('current_table', g_list.getTableName());

gDialog.setPreference('sys_id_list', g_list.getChecked());

gDialog.setTitle('Multiple Assignment');

gDialog.render();

}

find_real_file.png

So, the lookup list in the above pic should only contain the members of the assignment groups of the selected records. Please can you advise me how to do that?

1 ACCEPTED SOLUTION

Arpan6
Giga Guru
5 REPLIES 5

Harish KM
Kilo Patron
Kilo Patron

Hi Harish,



Thanks for the update. But , I don't have the assignment group on the UI page. I only have the user field in that UI page. I want to fetch the assignment group values from the selected record in a list view.



find_real_file.png


find_real_file.png


So, according to the images above, I want only the members of 'Service Desk' & 'Software' to show in the look up list of the 'Assignee' field in the dialog window. Is there a way to pass the assignment group values in the UI page?


Arpan6
Giga Guru

Does anyone have any idea how to set the reference qualifier as stated above?



Regards,


Arpan


Arpan6
Giga Guru