You need to sign in to do that
Don't have an account?

when child cases Status update then parent case Status also updated in Trigger
Hi Team
can anyone provide code for below scenario by using Triggers:
When all child cases closed/ cancelled / Completed, then parent case also be Closed /Cancelled / Completed...
Can you pls provide code for this ...........Thanks
can anyone provide code for below scenario by using Triggers:
When all child cases closed/ cancelled / Completed, then parent case also be Closed /Cancelled / Completed...
Can you pls provide code for this ...........Thanks
1) Create a after update trigger on case object which can make a future call to another method by passing a parent case id's of updated cases.
2) From future method make SOQL to pull all child cases of parent case ids and determine the status of child cases and come to the conclusion to update a parent case with right status.
3) I would recommend to use asynch processing in your case as making updates to case table again in the same transaction lead to recurssive problems. You could also perform the same via trigger as well.
Choose this reply as best answer if its helpful
Cheers!!
You can use the below code.
<<<<---Apex Class----->>>
<<<<----Apex trigger--->>>
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks and Regards,
Ajay Dubedi
www.ajaydubedi.com
I tested your code , but it works if any child case status updated then updating same parent case status.
But my requirment is all child cases status updated, then only parent case status update..
for example :
i have parent case number # 100
and this parent case 3 child cases ( 101, 102,103).
Now when i update all child cases status is closed then parent case status also be closed,,
once again thanks for your support on this