# How to add pyWorkStatus before we click "begin" and after we click "begin"

**URL:** <https://forums.pega.com/t/how-to-add-pyworkstatus-before-we-click-begin-and-after-we-click-begin/8747>\
**Category:** User Experience\
**Tags:** user-experience, pega-platform, system-architect, case-management\
**Created:** [December 16, 2024, 3:03pm UTC](https://forums.pega.com/t/how-to-add-pyworkstatus-before-we-click-begin-and-after-we-click-begin/8747 "2024-12-16T15:03:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![JubelynMaeC17092380](https://avatars.discourse-cdn.com/v4/letter/j/858c86/32.png) [@JubelynMaeC17092380](https://forums.pega.com/u/JubelynMaeC17092380)\
**Post date:** [December 16, 2024, 3:03pm UTC](https://forums.pega.com/t/how-to-add-pyworkstatus-before-we-click-begin-and-after-we-click-begin/8747/1 "2024-12-16T15:03:08Z")

</div>

Hi all, I have this requirement to add pyWorkStatus before we click the “begin” button, and the status will change after we click the begin button.

See sample scenario as below:

- When we open the case, the WorkStatus is “Pending-Review” (before we click the begin button)

- Once we click the “begin” button, the WorkStatus will change to “Review”

I tried to add the status in preDT and postDT but only the “Review” status appeared in the screen and the “Pending” status only display in the audit.

Can someone help me the solution please?

---

<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:** [December 16, 2024, 3:24pm UTC](https://forums.pega.com/t/how-to-add-pyworkstatus-before-we-click-begin-and-after-we-click-begin/8747/2 "2024-12-16T15:24:31Z")

</div>

@JubelynMaeC17092380

Can you add it on the shape where the case is currently standing? So the status should change when the process enters the shape, then when the case is opened the new status should reflect.

---

<div class="post-metadata">

**Author:** ![PrakashDeep](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/prakashdeep/32/12790_2.png) [@PrakashDeep](https://forums.pega.com/u/PrakashDeep)\
**Post date:** [January 5, 2025, 7:51am UTC](https://forums.pega.com/t/how-to-add-pyworkstatus-before-we-click-begin-and-after-we-click-begin/8747/3 "2025-01-05T07:51:35Z")

</div>

@JubelynMaeC17092380

As Soham mentioned, You can keep the “Pending-Review” status on the assignment level in the flow, so that the default status assigned to those cases are pending review before you start working on them.

on the flow action Pre DT, you can add the “Review” status so that when you click on begin button, it changes the status as provided in the pre DT for the flow action.

---

<div class="post-metadata">

**Author:** ![JubelynMaeC17092380](https://avatars.discourse-cdn.com/v4/letter/j/858c86/32.png) [@JubelynMaeC17092380](https://forums.pega.com/u/JubelynMaeC17092380)\
**Post date:** [January 13, 2025, 2:49pm UTC](https://forums.pega.com/t/how-to-add-pyworkstatus-before-we-click-begin-and-after-we-click-begin/8747/4 "2025-01-13T14:49:30Z")

</div>

@PrakashDeep

Hi I did try your suggestion, and it is working. However, when I click the “begin” button the status still in “Pending-Review” but with I click “Refresh” option from the action Tab, the assignment status changed to “Review” status.

I think case status issue is more likely solved, except for the “refresh” option.

I did try to call the OOTB activity from pre DT in the flow actiob to refresh the harness but it is not working

Do you have any suggestion to automatically refresh the harness once I click begin?

Thank you 🙂

---

<div class="post-metadata">

**Author:** ![PrakashDeep](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/prakashdeep/32/12790_2.png) [@PrakashDeep](https://forums.pega.com/u/PrakashDeep)\
**Post date:** [January 14, 2025, 9:39am UTC](https://forums.pega.com/t/how-to-add-pyworkstatus-before-we-click-begin-and-after-we-click-begin/8747/5 "2025-01-14T09:39:13Z")

</div>

@JubelynMaeC17092380

You can write one javascript which will refresh the harness onload of the section. you can take a look at pega.desktop.showHarness function for reference.

---

<div class="post-metadata">

**Author:** ![JubelynMaeC17092380](https://avatars.discourse-cdn.com/v4/letter/j/858c86/32.png) [@JubelynMaeC17092380](https://forums.pega.com/u/JubelynMaeC17092380)\
**Post date:** [January 14, 2025, 10:18am UTC](https://forums.pega.com/t/how-to-add-pyworkstatus-before-we-click-begin-and-after-we-click-begin/8747/6 "2025-01-14T10:18:42Z")

</div>

@PrakashDeep

Thank you for your response and suggestion. Do you have a link for pega.desktop.showHarness function ?

---

<div class="post-metadata">

**Author:** ![Sairohith](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/sairohith/32/23362_2.png) [@Sairohith](https://forums.pega.com/u/Sairohith)\
**Post date:** [January 16, 2025, 2:31am UTC](https://forums.pega.com/t/how-to-add-pyworkstatus-before-we-click-begin-and-after-we-click-begin/8747/7 "2025-01-16T02:31:57Z")

</div>

@JubelynMaeC17092380 The `pega.desktop.showHarness` function in Pega is a JavaScript method used to display a specific harness dynamically without reloading the entire page. This function is useful when you want to update the user interface with a new harness, such as opening a form or refreshing a section. Thanks
