Hello Uwe
What you can do is to simply create a microflow to delete the hanging Details objects and trigger it in your cloud environment as an admin user.
In the future I advise you to enable delete behaviour on the association between your objects. This will ensure that no hanging Details objects will be kept in the database if the Master objects are removed. (it's called cascading delete and you can read more about it
here -> https://academy.mendix.com/link/modules/722/Ensuring-your-Data-is-Valid-and-Consistent
or here -> https://docs.mendix.com/refguide/configuring-a-domain-model/#delete-behavior
Hope this helps!
Uwe,
In case this is helpful, the Xpath for finding orphaned Detail objects in Mendix would look like this:
[not(MyFirstModule.Detail_Master/MyFirstModule.Master)]
When I started out with Mendix, this Xpath took me some time to find and learn.
So the microflow would look like this:
Maybe that will be helpful.
Mike
In addition to the given answer, the following points can also be mentioned to strengthen the solution:
Direct SQL deletion is not recommended
Batch or scheduled cleanup approach
Safe selection of orphan records
Always test in non-production first
Prevent future issues
In short:
While deleting orphan records via SQL is possible, the best practice in Mendix is to handle cleanup through microflows in a controlled, traceable, and safe way.