Cancel HR Lifecycle Event Case

YounseoC
Tera Contributor

Hi, I'm making a lifecycle event case for onboarding new hire.

I opened a lifecycle event case and tried cancelling by clicking the cancel button.

A form to enter a reason for cancellation opens and when I submit, nothing happens.

I thought that the tasks in the case and the case itself will be changed to "Cancelled" state, but it stays the same, the screen stays the same.

I want to know the reason and how I can get the cancel to work.

 

7 REPLIES 7

Priyankagupta
Giga Guru

@YounseoC , Enable Rescind on the lifecycle event process. The "Rescind process" is used to cancel or revert an HR Case or HR Task.

 

Refer - 

Configure the rescind process for a lifecycle event

Lifecycle Event Best Practices and Performance Expectations - Support and Troubleshooting

 

Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Wessel van Enk
Tera Guru
Tera Guru

Hi,

As @Priye mentioned, you can setup the rescind, but this is just to revert the progress you have made in that case, but you should be able to cancel it without it as well. 

I just tried to cancel a Lifecycle case on my PDI and it works as expected. The case is cancelled and tasks are cancelled as well (if they have not been completed yet). 

See the UI action below. Are you using this OOB action? 

Wessel_0-1739176134360.png

 

I figured out how to cancel. But when I cancel lifecycle event case, the tasks related won't change to "Cancelled". Can you help me with the reason why?

Both happened when I used the OOB UI Action. See my example attached.
This was a case on the sn_hr_le_case table, but the UI action itself is created on the parent table (sn_hr_core_case). 

Did you modify the OOB UI Action?
If so, maybe try reverting it. 

 

Wessel_0-1739265722258.png

 

Script:

function cancelCase() {
        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('Enter the reason for canceling the case');
        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', 'cancelCase');
        dialog.setPreference('sysparm_is_required', false);
        dialog.setPreference('sysparm_is_comment', 'false');
        dialog.on('hrComentDialogSucess', function() {
            dialog.destroy();
            gsftSubmit(null, g_form.getFormElement(), 'sysverb_update_and_stay');
        });
        dialog.render();
        return;
}