Posted: 13 Nov 2019 11:29 EST Last activity: 19 Nov 2019 1:34 EST
On click of "x" next to case need to display a custom popup
We have some requirement in my project. When we initiate the case, on click of "x" mark next to case id need to display a custom popup with "Cancel" and return to "Return to work". On click on Cancel, need to navigate to the dashboard screen. On click of "Return to work", stays in the same screen.
Could any of you have the similar requirements? please help us.
***Edited by Moderator Marissa to update platform capability tags****
Please follow the following steps to achieve the requirement. I assume that you are on PEGA 8 (the solution should work for all versions of PEGA) and DynamicContainer is used to show tab dynamic tabs.
I'm making use of "Dirty popup" concept to achieve the requirement. Usually, the dirty popup shown when we try to close the work object with unsaved data and the popup is promoted to challenge the user to discard the changes or save the changes and close. I'm customizing this feature with minimal code effort to achieve the requirement and the popup should be shown irrespective of the form is dirty or not (always)
On your perform harness or any harness that is showing in the tab content should have the following setting "unselected" always
Open Harness > Go to Advanced tab > Do not display dirty warnings (checkbox should be unselected)
1) Open the rule work-pyDirtyCheckConfirm and save into application rule set and update the button lables and actions as needed
Cancel button Actions configuration :
Return to work button configuration of actions tab :
Now popup that to be shown is ready. This will be shown when we click on X icon of the tab only when form is dirty. So, now we have to take make sure that form is always dirty.
Create a non-auto generated section and copy and paste the following code snippet. [The following code is copied and edited from the section @baseclass.pxDisableClientDirtyDetection. if you are different PEGA version, open the rule and update the code set("gDirtyOverride", true) instead of set("gDirtyOverride", false) ]
Also, I see that you are trying to include the non-auto generated section where the code present in "User Portal" harness instead of work object harness. The work object harness usually would be Perform unless it is customized with a different name in application. So better, open the work object as a dynamic container tab and open your Live UI tool to find the harness by pointing the Live UI to rules with in the work object content. Open the most recent harness found in Live UI and include the non-auto generated section.
It works for me in PEGA 7.2.1 too with same approach. The only difference is code snippet. which I have given here. Hope you are able to achieve the functionality this time.
Please feel free to reply if you have any questions.