How to model Source/Origin/Starting point data in mendix?
Hi all, i have been modelling Mendix applications for the last year and every now and then i seem to encounter this issue again. So i was wondering what are your thoughts about this issue? Here is the thing, when you have a mendix application often you have the possibility to add data from different starting points. For example you can Create an Order from an Order Overview or you can add a Order from an Order Overview inside a Customer dataview. Now say that you create a new order from inside a customer. Because you created it from inside the customer dataview it will either directly prefill the link to the customer (assuming you used a datagrid over the association) or you need to prefill the association with a microflow. So now comes the tricky part. Say an order also has an association to a contact person. The contact person ofcourse is working for a customer and because you created the order from inside a customer dataview you already know this customer. However, because you do not want to store any bogus data in the database you did not store the data but just passed it along. How to ensure that the shown contact persons inside your order are only contact persons working at the selected customer? Normally i would use Xpath to solve this trick, but because you did not store the association between order and customer yet it cannot be of any help here. So then i finally tried changing my relationship types so i could use the constrain by attribute which did the trick. But this does require you to use a reference set. The two remaining options seem to be to either add a temporary selected object, or to commit your newly created order but i really dislike both of these options as they only introduce more bogus data. So what are you opinions about this? How did you solve similar problems like this and should one use bogus data to create a more user friendly user interface? Or use a reference set to be able to use the constrain by attribute?
Pieter van de Braak
How about using a microflow for the source data of the reference selector you want to use?