When parent case state is closed incomplete child task state needs to closed incomplete

nikhitha24
Tera Guru

Hi All,

 

Can anyone please help me on the below query,

 

When parent (Life cycle event case) case state is closed incomplete child task state needs to closed incomplete.

Please suggests me how to do the changes for this,

Is there aby OOB configurations available.

 

Thank you,

3 REPLIES 3

Omkar Kumbhar
Mega Sage
Mega Sage

Hello @nikhitha24 ,

Can you please check if there is any business rule configured on the Parent table check if there are any child task and they are updating or not you can achieve this requirement via Creating the business rule on the Parent table and add condition when the state is closed incomplete.

If I was able to help you with your case, please click the Thumb Icon and mark as Correct.

Sandeep Rajput
Tera Patron
Tera Patron

@nikhitha24 Unfortunately, there is no OOB configuration for this. However, you can choose to create an onBefore update business rule on sn_hr_le_case as follows.

 

Screenshot 2023-10-04 at 4.19.09 PM.pngScreenshot 2023-10-04 at 4.23.01 PM.png

 

Here is the script for you.

 

(function executeRule(current, previous /*null when async*/) {

	// Add your code here
	var glideHRTask = new GlideRecord('sn_hr_core_task');
	glideHRTask.addQuery('parent',current.getValue('sys_id'));
	glideHRTask.query();
	while(glideHRTask.next()){
		glideHRTask.setValue('state','4'); //4 is closed incomplete
		glideHRTask.update();
	}

})(current, previous);

Hope this helps.

Amit Gujarathi
Giga Sage
Giga Sage

HI @nikhitha24 ,
I trust you are doing great.
Please refer the below video for the same


Was this answer helpful?


Please consider marking it correct or helpful.


Your feedback helps us improve!


Thank you!


Regards,


Amit Gujrathi