# How to cancel parent case upon canceling child case

**URL:** <https://forums.pega.com/t/how-to-cancel-parent-case-upon-canceling-child-case/8434>\
**Category:** General\
**Tags:** generative-ai, case-management\
**Created:** [October 10, 2024, 5:21pm UTC](https://forums.pega.com/t/how-to-cancel-parent-case-upon-canceling-child-case/8434 "2024-10-10T17:21:16Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![RaghavN2](https://avatars.discourse-cdn.com/v4/letter/r/94ad74/32.png) [@RaghavN2](https://forums.pega.com/u/RaghavN2)\
**Post date:** [October 10, 2024, 5:21pm UTC](https://forums.pega.com/t/how-to-cancel-parent-case-upon-canceling-child-case/8434/1 "2024-10-10T17:21:16Z")

</div>

How to cancel parent and other child cases after cancelling child case in pega?

---

<div class="post-metadata">

**Author:** ![SohamM95](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/sohamm95/32/4726_2.png) [@SohamM95](https://forums.pega.com/u/SohamM95)\
**Post date:** [October 14, 2024, 5:15am UTC](https://forums.pega.com/t/how-to-cancel-parent-case-upon-canceling-child-case/8434/2 "2024-10-14T05:15:17Z")

</div>

@RaghavN2

You can use an ‘Update a case’ shape to move the parent case to an alternate stage where it resolves to Resolved-Cancelled and ‘Resolve open child cases’ checkbox is checked in the stage.

---

<div class="post-metadata">

**Author:** ![RaghavN2](https://avatars.discourse-cdn.com/v4/letter/r/94ad74/32.png) [@RaghavN2](https://forums.pega.com/u/RaghavN2)\
**Post date:** [October 14, 2024, 4:44pm UTC](https://forums.pega.com/t/how-to-cancel-parent-case-upon-canceling-child-case/8434/3 "2024-10-14T16:44:25Z")

</div>

@SohamM95 hi Is it Update a case or change stage pls confirm, if it is Update a case shape pls elaborate

---

<div class="post-metadata">

**Author:** ![SohamM95](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/sohamm95/32/4726_2.png) [@SohamM95](https://forums.pega.com/u/SohamM95)\
**Post date:** [October 15, 2024, 6:11am UTC](https://forums.pega.com/t/how-to-cancel-parent-case-upon-canceling-child-case/8434/4 "2024-10-15T06:11:22Z")

</div>

@RaghavN2

You can use Update a case shape where you can form your own logic to update the parent case and move it to alternate stage using pxChangeStage where you can resolve all the child cases.

---

<div class="post-metadata">

**Author:** ![Vikky22](https://avatars.discourse-cdn.com/v4/letter/v/a4c791/32.png) [@Vikky22](https://forums.pega.com/u/Vikky22)\
**Post date:** [October 15, 2024, 5:13pm UTC](https://forums.pega.com/t/how-to-cancel-parent-case-upon-canceling-child-case/8434/5 "2024-10-15T17:13:41Z")

</div>

@RaghavN2

It can be achieved by using activity but Activities are not recommended by Pega.

In update case shape select single case and give`.pxCoverInsKey in withID parameter which `will refer to parent case and write a own DT and Refer call OOTB Activity (pxForcecaseclose) using function to call activity in DT and pass parameters Parent WO ID ,WorkStatus this will close all the cases and it subcases.

Refer to OOTB pxForcecaseclose Activity.

---

<div class="post-metadata">

**Author:** ![Vikky22](https://avatars.discourse-cdn.com/v4/letter/v/a4c791/32.png) [@Vikky22](https://forums.pega.com/u/Vikky22)\
**Post date:** [October 15, 2024, 5:17pm UTC](https://forums.pega.com/t/how-to-cancel-parent-case-upon-canceling-child-case/8434/6 "2024-10-15T17:17:28Z")

</div>

@RaghavN2

Approach 1 :

Call update status shape and select single case then Configure your update shape as follows. `.pxCoverInsKey` will refer to parent case.

Approach 1:

Refer DT Step 1 : Param.inskey = pyWorkCover.`pxCoverInsKey`

`Step2: Call OOTB pxForcecaseclose activity as pass the required params`

Function to call activity in Data transform @Utilities.pxExecuteAnActivity(myStepPage, “`pxForcecaseclose`”)

`Other Approach :`

`In Data transform Call `pxChangeStage activity and pass Stage name as a parameter and in Alternate Stage -Select Resolve the case,case status and select Delete open assignments/Resolve open child cases.

Function to call activity in Data transform @Utilities.pxExecuteAnActivity(myStepPage, "pxChangeStage ")

Thanks,

Vikram

---

<div class="post-metadata">

**Author:** ![RameshSangili](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/rameshsangili/32/23377_2.png) [@RameshSangili](https://forums.pega.com/u/RameshSangili)\
**Post date:** [October 15, 2024, 2:07pm UTC](https://forums.pega.com/t/how-to-cancel-parent-case-upon-canceling-child-case/8434/7 "2024-10-15T14:07:57Z")

</div>

@RaghavN2

You can configure an utility in Child case “Canceled” stage. Build a custom logic to perform change stage for Parent and other child cases to move it to “Resolved-Cancelled” stage based on your requirements (if one of the child is cancelled).
