- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2021 02:00 AM
Hello Community Folks,
We are using ITSM Applications and we are looking for pop up window when user click the resolve button
it should display below fields in pop up window
1.Resloution code(Drop down values also should come)
2.Resulution notes
Note : when popup open we should mandate both fields values if anyone click ok without entering values it should populate error message and also we are looking to include this code in resolve button without breaking existing functionality
We are not experts to achive this can anyone help with code to sort out this it would be appreciated
Thanks,
Steve An
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2021 08:51 PM
here is the sample on how to show choice and update
enhance as per your need
UI Page Name: show_resolution_code_notes
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="jvar_sysid"
expression="RP.getWindowProperties().sysid"/>
<table border="0" width="100%">
<tr>
<td>
<g:ui_multiline_input_field name="resolution_notes" label="Resolution Notes" mandatory="true" />
</td>
</tr>
<tr>
<td>
<g:ui_choice_input_field id="resolution_code" name="resolution_code" label="Resolution Code" onChange="populateChoices()">
<option value="none">${gs.getMessage('--None--')}</option>
<option value="Solved (Work Around)">Solved (Work Around)</option>
<option value="Solved (Permanently)">Solved (Permanently)</option>
</g:ui_choice_input_field>
</td>
</tr>
<tr>
<td>
<g:dialog_buttons_ok_cancel cancel="return onCancel();" ok="return onSubmit();"/>
<input type="hidden" id="task_sys_id" name="task_sys_id" value="${jvar_sysid}"/>
</td>
</tr>
</table>
</g:ui_form>
</j:jelly>
Client Script:
function onCancel() {
GlideDialogWindow.get().destroy();
return false;
}
function onSubmit() {
var data = gel('resolution_notes').value;
var dropdown = document.getElementById("resolution_code");
var closeCodeValue = dropdown.options[dropdown.selectedIndex].value;
var sysId = gel('task_sys_id');
var app = new GlideRecord("incident");
if(app.get(sysId)){
app.close_code = data;
app.close_code = closeCodeValue;
app.update();
}
window.open('/incident.do?sys_id='+sysId);
}
UI Action:
1) Client checkbox - true
2) Onclick - confirmAction()
function confirmAction() {
var dialog = new GlideDialogWindow('show_resolution_code_notes');
dialog.setTitle('Resolve');
dialog.setPreference('sysid', g_form.getUniqueValue());
dialog.render();
}
Output:
If my response helped you please mark it correct to close the question so that it benefits future readers as well.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2021 03:44 AM
Hi,
sorry I didn't get your question
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2021 03:54 AM
We are planning to shutoff the OOB approach or we introduce the popup window approach also the users to experience for quick resolve
It would be great help if you share code based on our requirement
Thanks,
Steve An
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2021 04:09 AM
the above links should help you
they show how you can update the record using UI page
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2021 12:50 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2021 08:51 PM
here is the sample on how to show choice and update
enhance as per your need
UI Page Name: show_resolution_code_notes
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="jvar_sysid"
expression="RP.getWindowProperties().sysid"/>
<table border="0" width="100%">
<tr>
<td>
<g:ui_multiline_input_field name="resolution_notes" label="Resolution Notes" mandatory="true" />
</td>
</tr>
<tr>
<td>
<g:ui_choice_input_field id="resolution_code" name="resolution_code" label="Resolution Code" onChange="populateChoices()">
<option value="none">${gs.getMessage('--None--')}</option>
<option value="Solved (Work Around)">Solved (Work Around)</option>
<option value="Solved (Permanently)">Solved (Permanently)</option>
</g:ui_choice_input_field>
</td>
</tr>
<tr>
<td>
<g:dialog_buttons_ok_cancel cancel="return onCancel();" ok="return onSubmit();"/>
<input type="hidden" id="task_sys_id" name="task_sys_id" value="${jvar_sysid}"/>
</td>
</tr>
</table>
</g:ui_form>
</j:jelly>
Client Script:
function onCancel() {
GlideDialogWindow.get().destroy();
return false;
}
function onSubmit() {
var data = gel('resolution_notes').value;
var dropdown = document.getElementById("resolution_code");
var closeCodeValue = dropdown.options[dropdown.selectedIndex].value;
var sysId = gel('task_sys_id');
var app = new GlideRecord("incident");
if(app.get(sysId)){
app.close_code = data;
app.close_code = closeCodeValue;
app.update();
}
window.open('/incident.do?sys_id='+sysId);
}
UI Action:
1) Client checkbox - true
2) Onclick - confirmAction()
function confirmAction() {
var dialog = new GlideDialogWindow('show_resolution_code_notes');
dialog.setTitle('Resolve');
dialog.setPreference('sysid', g_form.getUniqueValue());
dialog.render();
}
Output:
If my response helped you please mark it correct to close the question so that it benefits future readers as well.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader