How to make Assigned To mandatory when clicking Resolve button on HR Case
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Hi Community,
I have an existing Resolve UI Action on the HR Case (sn_hr_core_case) table.
Currently, when the user clicks Resolve, the system prompts the user to enter Work Notes and then resolves the case.
Below is the existing UI Action script:
function resolve() {
if (g_form.getValue('work_notes') == ''){
var sysId = typeof rowSysId == 'undefined' || rowSysId == null ?
g_form.getUniqueValue() : rowSysId;
var dialogClass = GlideModal ? GlideModal : GlideDialogWindow;
var dialog = new dialogClass('sn_hr_core_HR Comment Dialog');
var msg = new GwtMessage().getMessage('Provide a summary of the work performed');
dialog.setTitle(msg);
dialog.setPreference('sysparm_task_sys_id', sysId);
dialog.setPreference('sysparm_ok_method_name', 'resolveCase');
dialog.setPreference('sysparm_task_table', 'sn_hr_core_case');
dialog.setPreference('sysparm_is_required', true);
dialog.setPreference('sysparm_is_comment', 'false');
dialog.render();
return false;
}
gsftSubmit(null, g_form.getFormElement(), 'resolveCase');
}
if(typeof window == 'undefined')
resolveHRCase();
function resolveHRCase(){
if (current.skip_automatic_user_acceptance_state)
current.state = 3;
else {
current.sla_suspended = true;
current.sla_suspended_on = new GlideDateTime().getDisplayValue();
current.state = 20;
}
current.update();
action.setRedirect(current.getLink(true));
}
I need to modify this existing functionality so that Assigned To is required when the Resolve button is clicked.
Expected behavior:
- If Assigned To is blank, do not allow the case to be resolved and make/display Assigned To as mandatory.
- If Assigned To is populated, continue with the existing Work Notes popup and Resolve functionality.
- The existing Work Notes popup behavior should not be affected.
- Other actions such as Spam/Duplicate should continue to allow Assigned To to be blank.
What would be the best way to add the Assigned To validation specifically to the Resolve UI Action without affecting the existing functionality?
Thanks!
0 REPLIES 0