StackOverFlow error on event handler

0
Hi, I have a product inventory system that is bound to users. When a user stores a new inventory item, I want to associate this new item with the current user. To do this, I added an event to my model (see image blow) that calls a microflow which adds the user to the object. The microflow can be seen here: https://modelshare.mendix.com/models/19373399-ba09-4aad-a92e-7a87fdebf5e7/new-inventory-item On the creation page, I've added an action button that executes this microflow. However, when the user clicks on this button, I get two errors. The first one is this StackOverFlow error: The second is this AskTimeoutException: What am I doing wrong? Thanks in advance! This is how the event in my model is configured:
asked
2 answers
2

So, If I read this correctly, newInventoryItem commits an inventory object, which triggers newInventoryItem, which commits an inventory object, which triggers newInventoryItem, which commits an inventory object, which triggers newInventoryItem, which commits an inventory object, which triggers newInventoryItem, which commits an inventory object, which triggers newInventoryItem, which commits an inventory object, which triggers newInventoryItem, which commits an inventory object, which triggers newInventoryItem, which commits an inventory object, which triggers newInventoryItem, which commits an inventory object, which triggers newInventoryItem, which commits an inventory object, which triggers newInventoryItem, which commits an inventory object, which triggers newInventoryItem, which commits an inventory object, which triggers newInventoryItem, which commits an inventory object, which triggers newInventoryItem, which commits an inventory object.

In any case, it's probably not a good idea to commit with events in a Before commit microflow.

answered
1

Your Commit action triggers the Before Commit event which calls the microflow again adding it to the stack. You got an infinite loop.

answered