- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-17-2020 01:31 AM
Hi,
We raise a HR Life Cycle Case from UI page we would like to get the Subject Person on the short description,
1) On Submit
2) On Change
once the parent case subject person is change all the child cases & task will have also changed
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-17-2020 01:40 AM
Hi Vamsi,
For setting the short description you can use before insert BR on LE Case table
Script:
current.short_description = 'Subject Person is ' + current.subject_person.getDisplayValue();
For updating the child cases and tasks once parent case subject person is changed use the business rule
BR: After update on HR LE Case table
Condition: subject person changes
Script
var child = new GlideRecord('sn_hr_core_case');
child.addQuery('parent', current.sys_id);
child.query();
while(child.next()){
child.subject_person = current.subject_person;
child.update();
}
var childTask = new GlideRecord('sn_hr_core_task');
childTask.addQuery('parent', current.sys_id);
childTask.query();
while(childTask.next()){
childTask.subject_person = current.subject_person;
childTask.update();
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-17-2020 01:40 AM
Hi Vamsi,
For setting the short description you can use before insert BR on LE Case table
Script:
current.short_description = 'Subject Person is ' + current.subject_person.getDisplayValue();
For updating the child cases and tasks once parent case subject person is changed use the business rule
BR: After update on HR LE Case table
Condition: subject person changes
Script
var child = new GlideRecord('sn_hr_core_case');
child.addQuery('parent', current.sys_id);
child.query();
while(child.next()){
child.subject_person = current.subject_person;
child.update();
}
var childTask = new GlideRecord('sn_hr_core_task');
childTask.addQuery('parent', current.sys_id);
childTask.query();
while(childTask.next()){
childTask.subject_person = current.subject_person;
childTask.update();
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2021 03:11 AM
Hey Ankur,
I have a similar kind of issue. I want to update the short descriptions for all HR template(This HR template are then used for creating HR task) so that it shows name of opened for person (Task is opened for). Can you please help me regarding this
Thanks