Support Article
Saving data from a harness does not turn off the dirty flag
SA-14055
Summary
There is a button with a Click Action, that calls an activity to save the user data before clicking Cancel to close the harness, in a harness. Despite this, the Confirm close dialog appears. This occurs because the dirty flag is not reset.
Steps to Reproduce
- Open a work object.
- Update some data.
- Click the custom save button to save the data into the database.
- Click Close to close the work object.
Root Cause
An issue in the custom application code or rules. When tasks are performed in the harness then the dirty flag is set to true. Closing or refreshing this work object after that will display the dirty popup. It is an expected behavior.
Resolution
Perform the following local-change:
Reset the dirty flag after saving all the data by one line java script.
pega.u.d.clearDirtyState()
This action should be the last action on the onclick event on the button.
Published September 11, 2015 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.