- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2025 08:58 AM
Hello,
I have a scenario i.e. there is a Custom Parent table and Task table. when any Parent Record created under that 4 tasks are creating itself. So whenever
1. if at least one task went to 'Closed Complete' state(i.e. 1 task= Closed Complete, 3 tasks= Closed Skipped) Parent record should set to 'Closed Complete' or
2. if all Tasks(4) states are 'Canceled' (4 tasks = Closed Skipped) Parent Record state should set to 'Closed Skipped'.
I am using below After Business rule, It is working properly for 2nd Scenario but not working for 1st one.
Can anyone help me on this. Thanks in advance!😊
Please see the below code and screen shots for your reference.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2025 09:04 PM
Hello @BhargavaKumar 2, It would have been easier to compare if you had shared the screenshot of working one too. Nevertheless, can you please try to change the line 21 of your BR (I'm referring the SS for the line) to below and share the outcome?
//removing the else from here
if (tasks.active == false){
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2025 10:27 PM
Hi @Nishant8 ,
Thanks for the suggestion. It's working as expected when i modified the code as below.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2025 05:30 PM
Since it's one of these, I think the following is correct:
if (count >= 0 && count2 == taskcount ) {
↓
if (count > 0 ) {
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2025 09:04 PM
Hello @BhargavaKumar 2, It would have been easier to compare if you had shared the screenshot of working one too. Nevertheless, can you please try to change the line 21 of your BR (I'm referring the SS for the line) to below and share the outcome?
//removing the else from here
if (tasks.active == false){
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2025 10:27 PM
Hi @Nishant8 ,
Thanks for the suggestion. It's working as expected when i modified the code as below.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2025 10:44 PM
Hello @BhargavaKumar , Glad to hear that my suggestion helped you resolve the problem. If you don't mind then can you please accept my suggestion as solution too additionally so that in future if somebody faces the same problem, can refer the same and understand the problematic part. Thank you...
Regards,
Nishant