Rollback Uncommitted Changes to Original State

0
Hi Reader   I have a Questionnaire creation screen where user can create sections and within those sections there are multiple questions can be added, edited and deleted. The entity relationship is like: Template    <-1-----*-      TemplateSection     <-1-------*-    TemplateSectionQuestion   And I am using Change Object widget to add, update and delete the questions and sections. And there is a final submit button which will commit the objects. There is a cancel button, on which I have created a microflow to revert all the un-committed changes. The change object for delete activity is as follows:   The rollback microflow:   The rollback microflow is working fine, but its not able to rollback the delete operation, but when I am refreshing the page it is reverted. Am I doing something wrong for the rollback actions? Is there any way to achieve the rollback for such kind of operation?
asked
1 answers
-1

Rollback  is not intended to undo deleted objects. It can rollback changes that have not been committed yet.

 

You could also change the object and remove the association instead of removing the objects. This way the question or section won’t show on your page. When you want to undo the delete, you just rollback the changes and the association will be set back to it's original state. Add a refresh and the section or question should appear on your page again.

 

Also see: https://docs.mendix.com/refguide/rollback-object/

 

Hope this helps!

answered