Tie microflow to when new association is set/created

0
What's the easiest way to set a microflow to trigger when a new association is created? I have an object that can be associated with multiple accounts, and I'd like to setup a way to run a microflow to create an email to that account when a new association is made like an event handler. What would be the most efficent method?
asked
3 answers
1

Hi Jon, You could change the n-n relation between account and project to use an additional entity.

That way you can store additional information in the AccountProject entity as well (eg project role)

answered
0

Jon,

If the association is set via a page, you can send the email in an on change event for that reference (set) selector.  If the association is set via a microflow (for example, during a scheduled event or an event handler on a different attribute or on the entity itself), you can generate the desired email as part of the microflow process.

Does either of these 2 cases answer your question?

Hope that helps,

Mike

answered
0

Hi Jon,

 

Why don't you use a before or after commit microflow. Because in any case, changes to the association need to be commited to the DB by commiting the owner object. In your case since you have multiple accounts per object I am assuming a 1-* association. The before commit microflow needs to be set up on the many side

 

e.g.

Project 1 ---- *  Employee

You need a before commit event on the Account.

See the screenshot

 

Here is the before commit microflow in model share so you can see what is in the actions

https://modelshare.mendix.com/models/5f2e6c61-304f-444f-9528-a08a8e204847/b-co-employee

 

I tested this locally and works correctly.

 

I hope this helps,

Andrej

answered