metaobject event

2
1-what is the difference between after/before create commit with example? 2-Do I have to use invoke button to distinguish between new and update action to be able to call different microflows(to call one microFlow in case of new and another microflow in case of update) because If I use after commit, it will affects the new and update actions?
asked
3 answers
3

If I understand your question correctly, you want to know what the difference is between before and after commit events.

The difference is actually quite simple, before commit events are executed before the object is committed (thus, if you change the object, it will be committed right after, thus saving any changed you might have made in the microflow)

After commit flows are executed after the object has been committed to the database. In this case, if you change the metaobject and don't select 'commit', the changes are lost, as the object was already committed to the database prior to the flow. The after commit flows are usually used to trigger events on other metaobjects once you know that the commit was successful (ie datavalidation succeeded etc)

answered
3

About your second point:

If you want to check whether some object is new, you can use the following microflow function:

isNew($someObject)

Note that an object is only new when it hasn't been committed yet. So the last moment you can successfully detect a new object this way, is in the before commit action.

answered
0

thanks Achiel, Now I understand the first point. what about second point of distinguishing between new and update action to be able to call different microflows?

answered