Log Microflow that deleted object (before/after delete event)

0
In an app that I am working on, objects of a specific entity disappear and we can't find out how. I did a search for usage in action and chose delete and checked everywhere where it could have been deleted, but non seem possible.    So what I want to do is to add a before/after delete event on this entity that will log (in the mendix logs) all the relevant info so we can trace what happens. One crucial piece of information that I need is the Microflow that triggered it. But I don't know how to log that from an event handler. Any ideas?   Also if you have an idea how the object could be deleted outside of a microflow/nanoflow, please do tell! 
asked
1 answers
1

Joel,

Some things that I have seen cause this kind of behavior:

  • the entity is not successfully committed.  This can happen when you have an event handler on the entity that returns an error when trying to commit
  • the entity is associated to another entity and the association has auto delete behavior (i.e. delete all items on an order when the order is deleted)
  • permissions issues - something happens when creating or changing the object that means the logged in user no longer has permission to see it.  In this case, the object will still be in the database, but not visible to the logged in user

Unfortunately, as far as I know, you can't find the calling microflow from a delete event handler.  One thing you could do to help understand the behavior is to create a log entity of when the object was deleted, who the logged in user was and any other info that might help you track this down.  In the delete event handler, you could create log record objects.

 

Hope that helps,

Mike

answered