Detecting Changes And Prompting For Save

0
Hi – I know there have been posts on this topic, but the closest one that seems to describe what I’m trying to do is from this thread: https://community.mendix.com/link/questions/2293. So far, this is what I have: My microflow correctly detecting a change has been made to the page (aforesaid MF is tied to a button, and that button is tied to the “Close action” property of the page) I also have a new pop-up appearing with the same information WITHOUT the changes entered, hence the [ISSUE] below [ISSUE] When the user clicks the upper right X, the page closes and I’m unable to reapply the changes that were entered should the user choose to save Any ideas how I can “pseudo-save” the uncommitted changes (after the user clicks the top right X of the page and the page goes away) so I can make those changes available to save should the user choose to do so?
asked
3 answers
0

You can define the close action [the x] to a button – for example your cancel button

answered
0

Thank you for your feedback. That works, except I need that pop-up to be conditional only if changes were entered. So the sequence I’m looking for is:

  1. User clicks top right X
  2. Pop-up only appears if changes are entered, asking if the user wants to save
  3. If the user clicks Yes, the user has a way to commit the uncommitted changes

 

#2 is the issue. Using the delivered functionality, the pop-up shows all the time (even if changes aren’t entered) and isn’t conditional, where I only want the pop-up to show if the user has entered changes that need saved … Has anyone found a workaround to this? My workaround so far has been to hide the upper right X and use a “Close” microflow that does something similar to the steps above except it doesn’t get user input; it just tells the user to save if they want to.

answered
0
  1. Any ideas how I can “pseudo-save” the uncommitted changes (after the user clicks the top right X of the page and the page goes away) so I can make those changes available to save should the user choose to do so?

 

You could create a non-persistent entity wich is a copy of the original entity (same attributes) and make an assiciation to System/Session

The microflow to cancel (or X to close when attached to the cancel button) to trigger a microflow to create the non-persistent entity with the attributes you want to “pseudo save” and set the link to the current session.

By retrieving that non-persistent entity from the session you have the object with the not-saved changes, and can compare it to the original,  save it or do any other activity with it that you like.

answered