Moving deleted items from a page to another

0
Hi all,   I am trying to develop a small Mendix app for the employees management of a company. I have an Employee page where all the added employees are displayed with all their details. Now I want to develop a functionality when clicking the 'Delete' button, the deleted employees should disappear from the list and after that they should be moved to another page (like a Recycle Bin). Could you give me please some ideas how to do that as I'm relatively new to Mendix?    For the moment, I created the new page where the deleted employees will be displayed and also I created the microflow for deleting the employees from the Employees list. But now, I'm not sure how I should go on with the microflow which is called when pressing the 'Delete' button.   Thanks!
asked
3 answers
0

One approach could be to add a boolean attribute to your Employee entity called something like "isDelete". This can be set to true if the record is deleted in your delete microflow.

 

You can then change the XPath constraint on your Employee page to check that this value is false when selecting the objects to display. This will mean only Employees that haven't been deleted will be visible.

 

https://docs.mendix.com/refguide/xpath-constraints/

 

In addition to this, do the same on your other page (recycle bin), but change the XPath to check that this attribute is true. This means you'll only be showing the Employee objects that have been deleted on this page.

 

You could also add an undelete function, where you have a microflow that changes the value of the attribute back to false.

 

I hope this helps.

answered
0

Hi Robert, thanks for your help. But I have one question. How can I set that boolean value to true in my delete microflow? I added a 'Change object' activity to my microflow, but the only objects I can select are currentSession and currentUser.

1.png

answered
0

When I'm trying to pass a single object as a parameter to my microflow, I get this error related to the 'Delete' button.

1.png 

answered