Object data not available in After Create event when object is being created via a web service

0
Hi all, It seems that the data of an object (entity) is not available in the After Create event handler if the creation of that same object is triggered via a web service. When tracing I see that the web service message contains correct data while at the same time, when debugging the After Create microflow in the receiving app I see that the object is (still) empty. Can anyone confirm and explain this behavior? Regards, René
asked
3 answers
2

On create event handler is called after default values are set but before any changes to attribute values are applied such as from a create object action or a web service. This is well documented here - https://docs.mendix.com/refguide/event-handlers

answered
0

Hello Rene, 

On a wild guess I'd assume the web service call creates the object and then changes the respective attributes to the received values. From my experience the After create event is too reliant on the order of the actions performed.

I would suggest using a Before commit event if possible, or custom logic on your web service call to ensure the "create object" action contains all the data. 

Hope this helps.

answered
0

This explains a lot, though logically seen it does not seem logical ...

Thanks for the quick replies, guys!

answered