when are trying to take another action in unsaved form, pyDirtyCheckConfirm section is displaying with pop-up with few buttons, on click of discard its closing the case and moving back to Home Screen.
Not sure but ideal behvaiour should be just close the pop-up and stay on the same case.
As per Pega product design, whenever a reload / cancel action in the section is triggered in the flow execution due to any actions at runtime, the dirty state is set and the “Discard changes” pop-up appears.
If you want the dirty state popup (Discard changes) to be appear on screen, try the below code,
<script>
pega.u.d.gDirtyOverride = true;
</script>
**If the changes are to be reflected in a particular section (locally),**
- Create a non auto generated section, include the code in the HTML tab of the section. Include the above section in the other section where the changes are to be reflected.
**If the changes are to be reflected across the application,**
- Add the above code in the UserWorkForm**.**
__*If you don't want the dirty state popup (Discard changes) to be appeared on screen, set the above mentioned flag to 'false' and perform the above steps wherever needed.*__
<script>
pega.u.d.gDirtyOverride=false;
</script>
@Lalit_Singh - I believe that the behaviour that you have described is the expected behaviour and it behaves the same way in previous versions. If you click on “Discard” (while exiting or moving away from the case) it means you are fine with discarding the changes and moving out of the case. If you click on “Cancel” button on the pop you will remain in the same case.
To add more clarity to the behaviour you may want to rename the buttons (as per your needs) to make it more explicit.