- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 10:57 AM - edited 02-20-2024 11:00 AM
Hello @all,
I have a requirement to get the list of rejected cases - so for this I have created a new field(Case has been rejected=true) and created a business rule to update the rejected status. But I want the list of rejected HR Case numbers for old cases also.
How the case can be rejected -> we can identify this -> when a state changes from 'awaiting acceptence' to 'work in progress'.
So please help me to get the solution for this to get the list of rejected cases.
Below is the UI Action we are using for rejection -> when a user clicks on Reject Completion -> A dialog will appear -> by providing a reason in dialog box -> a user can reject the case.
function rejectCompletion() {
if (g_form.getValue('state') == 20) {
//if state has not changed
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 reason for reject completion');
dialog.setTitle(msg);
dialog.setPreference('sysparm_task_sys_id', sysId);
dialog.setPreference('sysparm_task_table', 'sn_hr_core_case');
dialog.setPreference('sysparm_ok_method_name', 'rejectCompletion');
dialog.setPreference('sysparm_is_comment', 'true');
dialog.on('hrComentDialogSucess', function() {
//g_form.setValue('u_case_has_been_rejected', true);
dialog.destroy();
gsftSubmit(null, g_form.getFormElement(), 'sysverb_update_and_stay');
});
dialog.render();
return;
} else {
//if state has changed show error message
g_form.addErrorMessage(getMessage("The state of the case has been updated recently. Please refresh the page."));
}
}
Kindly help me with your suggestions - @Rob Sestito @Eswar Chappa @Ankur Bawiskar
Thank you in advance.
kind regards
bhuvana
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2024 02:12 AM - edited 02-21-2024 02:13 AM
@bhuvana7, I have made some modifications to the script. Could you please check the changes?
Additionally, I would like to ask that you run the "fix script" within the HR Core scope to ensure that HR cases are accessible.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2024 02:18 PM
Hi @bhuvana7
Also, please include the following line in the code:
hrCaseGr.setWorkflow(false); before the line hrCaseGr.update();
Just to ensure it wont trigger any BR's or flows.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2024 02:30 AM
Thank you @Srinivasa1 , Updated.
Kind Regards
Bhuvana