- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-30-2017 03:54 AM
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();
}
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?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-01-2017 08:44 AM
Got an article that helped -
How to make a ui_reference field filter dependent on a different field
Thanks,
Arpan

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-30-2017 04:06 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2017 01:37 AM
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.
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-01-2017 05:33 AM
Does anyone have any idea how to set the reference qualifier as stated above?
Regards,
Arpan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-01-2017 08:44 AM
Got an article that helped -
How to make a ui_reference field filter dependent on a different field
Thanks,
Arpan