You AccountUser is associated with Administation.Account and in-turn with System.User.
System.User has LastLogin attribute.
With a scheduled event, you will be able to find users who are not logged in for “N” days and delete the users.
For associations, I am not sure if there are ways to get the associations in which the AccountUser is not a owner. May be you can try DB queries to know that.
But, simple way is: set the delete behavior on AccountUser. https://docs.mendix.com/refguide8/association-properties#delete-behavior
- Delete AccountUser only if it is not associated with
- Ofcourse you must do this for all primary associations
Hi Marcian,
In this case I do not think it is necessary to use a Java action. I would opt to use a scheduled event which runs every week.
In the scheduled event I would do a retrieve on contacts where the important associations are empty, or which haven't logged in for a while, whatever your condition is. If you want to reuse this in a different app, you'll only have to change this retrieve.
From there you can retrieve their accounts and delete both lists from the database.
Hope this helps!