Possible to edit an object in a data view from an associated object?
I am relatively new to mendix and I need some help. I have an entity called “customer’ and an entity called “Adress” with two 1-1 associations (Customer_PostalAdress) and (Customer_BillingAddress). Is there a way to edit the attributes of both Entities from a page that is given the customer parameter. For exmple when creating an overview page for customer and adding a new_edit for customer I also want to be able to edit the adresses associated with that customer. What I have tried untill now: - Retrieve the adresses by associaton, but this way I am not able to edit the fields –Create a microflow that checks if an address object exists and if not, create one, let this fill the fields. This solves the problem that I’m not being able to edit, but I cannot save the adress attributes that I want to associate with the customer entity. (I figure I need to make a custom save button, but I don’t exactly know since it expects a customer parameter) My domain model and page as of now:
First question is why you need a 1 to 1 association between your entities when you can put it in one entity. It is just more efficient that way. However, based on your domain model I can see that you want two address types; what I will do is have a 1 to many association to address and have an 'address type’. That's just another way
Secondly, if you choose to do it your way, make sure you set your security rights to both read and write for the fields that you need to modify. Make sure you set the association between both entities. Will be good to also see the Microflow that you have to set your association.
Sometimes, check the dataview. Éditable’is set to No sometimes, so set it to yes.