Example of a microflow that adds data to related entities

0
I am new to Mendix, I would like to create a Microflow that adds a record to a table and then also creates an associated record in the second table. For example: Recipes and Catalog are the two entities.  There is a one to one relationship between them (title).  So when I click  or "Add" from a view I want only one page to open that the user enters information into.  When completed the user clicks the 'Add' button.  A Recipe record is created and a Catalog record (associated) is created then the page closes. My though is that I could create two Sets (one for the Recipe) and another for the Catalog entity.  Then I would commit them and close the page.   Any assistince would be greatly appreciated.
asked
3 answers
0

On your editing page (I assume you already have that) create a custom save button that calls the microflow. In the microflow you can create the object for the other entity, set its attributes, set the association between both and then commit both of the objects (and close the edit page if you want).

Let me know if there is any of this you're not sure how to do.

answered
0

Johan,

THANK YOU!  When I was creating the microflow as you suggested it first added a duplicate entry to the Recipe table, but then I realized that I had to change the Set reference Entity to Catalog.  Then everything worked perfectly.

I have to say that Mendix is VERY COOL!  It is a much simpler way of building an application them before.

answered
0

Hi – how/where can this microflow be triggered to add records to associated entities, if the new records are coming from a file import? So once the file imports, I am trying to have any new records populated into the associated entity.

answered