Need help with history

0
Soo i have an entity that i want to store what happens in the collaborator entity, atributes changes, creation how can i do that
asked
2 answers
0

Hello Rafael,

 

You can do this with custom made code which in my opinion is the most safe way to do it, so just create an entity that logs the changes and creation of your entity, and place this on your entity event handler or just in your code at the places you want to use it.

 

Another option is use the audit trail module, this module is made for this, but it can lead to some side-effects with respect to the performance of you application because it can create quite some objects. 

 

More info here:

https://docs.mendix.com/appstore/modules/audit-trail/

 

 

Hope this helps

 

Good luck!

answered
0

Rafael,

We have created an entity with these attributes:

image.png

 

And the microflow that records changes (called in an event handler for each entity we want to track) looks like this:

For After Create event

image.png

 

For a Before Commit event

image.png

 

You'll need to create something like the above for each attribute you want to track.

 

Note that we keep the Object ID so we can query all changes for a specific object.

 

Hope that helps,

Mike

answered