- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2024 02:11 AM
Hi,
What is best approach in business rule. I have one requirement to update comments from HR task table to HR case table and I know how to achieve we can use before and after business rule to achieve that.
Can anyone please tell which best approach should I use before business rule or after business rule.
Regards,
Nivedita
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2024 02:19 AM
Create After BR rule and copy the notes.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2024 02:26 AM
Would recommend you to use After insert/update business rule on HR Task table with following Business Rule script-
(function executeRule(current, previous /*null when async*/) {
var caseGr = new GlideRecord('HR_Case'); //enter the correct table name
if (caseGr.get(current.hr_case)) {
caseGr.comments = current.comments;
caseGr.update();
}
})(current, previous);
Please mark my answer helpful and correct.
Regards,
Amit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2024 02:19 AM
Create After BR rule and copy the notes.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2024 02:26 AM
Would recommend you to use After insert/update business rule on HR Task table with following Business Rule script-
(function executeRule(current, previous /*null when async*/) {
var caseGr = new GlideRecord('HR_Case'); //enter the correct table name
if (caseGr.get(current.hr_case)) {
caseGr.comments = current.comments;
caseGr.update();
}
})(current, previous);
Please mark my answer helpful and correct.
Regards,
Amit