Retain the child case state when the parent case is Closed Complete/Closed Incomplete/Cancelled

Arpitha Gopalsw
Giga Guru

As per the OOTB behavior, if the Parent Case is Closed Complete/Closed Incomplete/Cancelled. The child cases gets auto-cancelled. However, We received the requirement to "Child cases should NOT be closed when parent case is closed" so i wrote a after BR to achieve this and this is causing an issue of not resolving an Child HR Cases due to the error "Invalid update". Please help me resolving this issue.

find_real_file.png

find_real_file.png

At the moment, We need to retain the Child HR Cases as it is, even if the Parent HR Case is closed incomplete/closed complete/cancelled.

Thanks in advance!

Regards,

Arpitha G

 

2 REPLIES 2

ErinF
Tera Expert

I recently had the same requirement brought forward.  This OOB behavior is coming from the business rule “Cancel or Close Case Cleanup” that calls a second script “hr_utils”. The "hr_utils" script include does many other behind-the-scenes clean-up actions, so I don't want to inactivate. 

Because best practice is to never edit an OOB script, what I plan to do is duplicate the script include and comment out the function that cancelled the child cases. Then, duplicate the "Cancel or Close Case Cleanup" business rule and edit to call the new script includes. 

Following this post for any additional feedback you receive. 

Hi Erin,

Thank you for the response.

I did try to comment out line no 1469 to 1472 in OOTB "hr_utils" script include and the issue was fixed. Below piece of code for reference.

if (gs.getUser().getName() == 'system' || new hr_Utils().checkUserHasRole(hr.ROLE_HR_CASE_READER))
this.cleanupChildRecordsForCase(grCase);
else
gs.eventQueue('sn_hr_core.case_cleanup', grCase);

However, overriding the OOTB impacts during future upgrades. Hence, we thought of making the copy of "hr_utils" & inactivate the OOTB script include. While performing this action, noticed that there were 20 OOTB BR's which uses OOTB script include.

Any alternative way on how to proceed on this without touching any other BRs & making a copy of OOTB script include "hr_utils"??

 

Regards,

Arpitha G