- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2019 07:22 AM
Hi folks,
Is there a way to mark all rejected hr cases in a single script? I am thinking to create a True/False field which will turn to true when a user clicks on ˇreject completionˇ or no in the HR portal.
I wanted to write a business rule on sn_hr_core_case table, but since so many tables are inherited from it, I guess that it will not work.
Any pointers on how to achieve this?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2019 09:31 AM
Hey Lemajeur,
So for the Business Rule way, I don't see why you could not use that with a true/false field. When Case is rejected in HR, it typically goes from Awaiting Acceptance State to WIP State (for us it does anyway).
I built a BR and True/False field on the HR Case Core Table (then within the other tables you would be using this for, you just need to configure the layout for their form to add the new field where you want it).
Here is what I did, and it works each time any case changes from Awaiting Acceptance to WIP (which constitutes as a "case being rejected for completion"):
However, if you are looking to report off of something like this, you may want to build something additional to move this field back to false when the Case is moved into Awaiting Acceptance again (or just have the Assigned To trained to uncheck the box when they attempt to resolve again).
Hope this helps - Let me know if it does or does not work for you. Maybe we can brainstorm more or another option.
Cheers!
-Rob

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2024 05:23 AM
Are these not cases that went through an approval process? If not, then I am not really sure what you can use to grab the correct case records. We don't want to use the normal hr case state field with something like, Incomplete because that can mean many things.
Is there some other difference that we can use? Maybe these cases you want are under a particular HR Service?
But we need something to signify their difference. That way we grab the right records for this change.
Let me know if you can use something more detailed if we cannot use the Approval state field.
Thanks,
-Rob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2024 01:42 AM - edited 02-15-2024 01:44 AM
Hi @Rob Sestito ,
Thanks for the response again.
Below is the UI Action script - we are using 'Reject Completion' button - user can reject the case by providing the rejection reason.
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."));
}
}
So is there any chance to update the 'reject count' field which I created newly - for all the rejected old HR Cases through this UI Action.
Kindly let me know the suggestions, Thank you in advance.
Kind Regards
Bhuvana

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2024 05:52 AM
Oh okay - I was thinking approvals like someone requesting a corp card or something like that, that typically goes through an approval process. My fault on that!
So, I am not sure there is a good way to check on old cases that have been rejected at some point. Mainly because that UI Action to reject the completion, moves cases back to a WIP state. And now, I am assuming those cases are closed complete. We could possibly write a script to check on hr cases that went from awaiting acceptance, to wip, and then to closed complete/incomplete. But, that doesn't always mean the rejection ui action was used.
It may be time to create a new post on this very question, and see if we can get help from others within the community. As of this moment, I cannot think of an easy way to check the old hr cases that have been rejected, to get them a count on your rejection field.
Sorry about that! If you create a new post with the question and tag me, I will continue trying to help and research.
Thank you,
-Rob

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2020 04:05 AM