BrainstormSession <- Idea (Parent-Child) - How to add new Ideas and have BrainstormSession FK set automatically?

0
I have tried to find the answer to this on the forum and on Udemy courses and on Mendix learning paths. I really have. This seems like a parent-child solution that would be very common. Perhaps I am not articulating my problem in the right way, but here goes.   In Studio Pro (9.14.1) I have a BrainstormSession entity and an Idea entity. A 1:M relationship. A brainstorm session can generate many ideas. I have a BrainstormSession overview form and a NewEdit form. I have an Idea form. I create a new BrainstormSession record and then press a button to open a responsive form to add Idea records. But I don’t want to have to choose the BrainstormSession parent every time I add an Idea. I want the Ideas form to know that all the Idea records belong to this BrainstormSession and automatically set the foreign key value. I don’t want to use the same form for BrainstormSessions and Ideas – I want separate forms. How do I constrain the Ideas form so that it knows it is for the selected parent BrainstormSession?   Thanks in advance for any help you can provide.
asked
1 answers
0

Hi Paul,

In you Add Idea Page, The parent Should be BrainstormSession Dataview, inside Dataview

Add A Datagrid to show the list of Ideas,

Enable Multi Selection in the Datagrid Properties. 

Add an Action Button Say It Select an Idea and Call a microflow, You microflow will now have two paramaters 

  1. List of Idea 
  2. BrainstormSession

Add a loop and iterate over Idea list and Associate the BrainstormSession object and at last close the page.

 

 

I have chosen Datagird since it has a Mutliselect option by Default. If you want to have a List view, you will have to tweak your Flow. The main aim is to have the BrainstormSession object as your Select microflow Parameter.

Another Way is You can change the Association to Many – Many and use a Reference Set Selector and right click on the Reference set selector and select Generate Page. Mendix Will take care of setting up the associations. 

I would prefer the first solution. Good Luck !!

Update :

 

answered