Onboarding tasks- comments on task level roll up to parent.

niveditakumari
Mega Sage

Hi, 

 


Onboarding tasks- comments on task level roll up to parent.

As an HR Agent, if an employee or manager submits a comment on an Onboarding task, I can see all of the comments on the HR Case. 

When employee or manager submits comment on Onboarding task then I should see all comments on HR case. 

Can anyone please help me to achieve it. 

 

Regards, 

Nivedita

 

 

1 ACCEPTED SOLUTION

@niveditakumari Deactivate your business rule in HR Core scope and create a copy of the same Business rule in Human Resources Lifecycle Events scope along with the same script. Ideally, this will address your scope error issue as the worknotes would be added into the LE scope only. 

View solution in original post

14 REPLIES 14

Sandeep Rajput
Tera Patron
Tera Patron

@niveditakumari There is an OOTB Business rule Validate Changes which rolls up the worknote to parent case already. Hence work_notes added by employee or manager should also roll up automatically unless they are adding additional comments instead of a work note.

HI @Sandeep Rajput , 

 

Thank you so much for your reply. 

Yes you are correct this functionality is already available for worknotes. 

I have to do this for additional comments. When employee or manager add additional comments it should show in HR case. 

Can you please help me to get this done. 

 

Regards, 

Nivedita

 

 

@niveditakumari Here comes the solution. Please create an onBefore Update business rule on HR Task and configure it as follows.

 

Screenshot 2023-04-21 at 8.34.00 PM.pngScreenshot 2023-04-21 at 8.34.07 PM.png

 

Here is the script for the business rule

(function executeRule(current, previous /*null when async*/) {
	
	// Add your code here
	if(current.parent){
	
		var parentHRCase = current.parent.getRefRecord();
		parentHRCase.comments = current.comments.getJournalEntry(1);		
		parentHRCase.update();
	}

})(current, previous);

 

Please mark my answer correct and helpful if it manages to solve your problem.

Hi @Sandeep Rajput

 

I tried this approach but it is showing this error. 

 

niveditakumari_0-1682158749993.png

 

Can you please help me with it. 

 

Regards, 

Nivedita