Adding a connection over a many to many association while manually changing 1 attribute; how to do it?
I've got the following situation; Entity A has a many to many relation with Entity B. I've got a page which shows Entity A with currently linked Entity B over a reference set. So that list shows the current entities B that have a connection to entity A. The page has a button to add an entity B to that list. That button shows a page with all available entities B which can be added with a default select button. No issues there. Now my issue, I want to be able to change one of the attributes (a percentage) while adding it. So you select the right entity, and then get a pop up screen where you adjust the percentage and then it gets added. The default button apparently has the right entity A information somewhere. My main issue right now is that i'm not able to retrieve the correct entity A to which Entity B, with adjusted attribute, should be linked. Any thoughts or suggestions? Little added information; i've currently got a workaround in which after the entity B is linked you can view details and then change the attribute. But I want to be able to do it whilst adding the connection, not afterwards.
Default funcionality of Mendix and set reference selectors are fine as long as you keep close to editing entity A (Page A_NewEdit). As soon as you also want to modify Entity B in the progress, stuff gets too complicated for Mendix to keep track.
Solution I use often is the use of an HelpEntity which contains 2 associations, 1 for Entity A and 2nd for Entity B. This HelpEntity is the caller of the Page of your pop-up after pressing "select association with B" on your A_NewEdit.
The association to A is your ticket back to A_NewEdit
The n association to B wil be used to Set List when leaving the pop-up.
While in the pop-up, its fine to open B in a B_NewEdit page and return to the pop-up as it holds a Caller of the Page.
With Mendix 7 coming up, the is now a deprecation made known that a Help Entity is no longer allowed to be Non-persistent, which was ideal in these temporarily entities. It just means it will become 'persistent' and correct roll back behavior should be applied in order to clean up the cash.