Posted: 1 May 2019 5:59 EDT Last activity: 9 Apr 2020 5:40 EDT
"Discard changes" popup in all places
"Discard changes" popup appears in many places, but not when you use a local action. It is by design, but it would be useful if it was possible to decide if the popup is applied in such situation as well, for example by DSS or a flag.
***Moderator Edit-Vidyaranjan: Updated SR details***
Thank you for posting your query in Pega Support Community!
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,
pega.u.d.gDirtyOverride = true;
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.
As an extension to the above information, when you launch a local action in between the flow, the section is not refreshed/reloaded as the same flow is being executed. Hence, the dirty state pop-up does not appears on screen.
Once the local action is launched and submitted the reload action is performed and the flow is returned to the previous section where the changes are made initially which are not retained. Since there is no Save action performed in the flow, the changes are not getting saved.
As a Local change, please try Post Value action on "Onchange" event of the property. Below is the screenshot for your reference,
The above mentioned local change will work only if the local action launched is submitted or saved.
In the local action if the 'Cancel' action is performed, a dirty state popup appears and if the changes are discarded, the details entered in the previous section will also get discarded as the same flow is being executed.