Mendix handels the foreign keys of the objects. You cannot define them yourself.
My assumption is that you have two entities Employee and WorkingEnvironment with an association in between.
Add a Create button (not the new button part of the datagrid itself) and configure it as follows (the new button configuration in studio is limited, in studio pro this is possible)
If you dont have unique identifier, even if you create microflow, it doesnot know to whom it needs to associate. If you are using the dataview and try to click new which has microflow, the employee parameter needs to be passed. Then create new object and its associations. Thanks
Ok, since I only work in Studio pro it might be a bit harder form me to explain. If the reference already exist between workenvironment and employee you do not need a microflow at all. Just drop the grid inside the dataview of the employee. If I am not mistaken it will only retrieve the workenvironments over the association between the two. When creating a new workenvironment it then will also automaticly set the reference to the employee.
If I don’t have a unique identifier in the data entry form after clicking “New work environment” than the system will not know the association between the data entered and the employee. which is why I need the Employee ID as a selection in the data entry form as the only unique identifier). So unless I add that to the data entry form, there’s no way for the data to display in the grid for that employee – correct? when I create “new” work environment from the employees profile page it is not automatically creating that association/reference and I’m unsure why. but as soon as I added the Unique ID drop down to select in the work environment data entry form it then displayed the data for the employee. I feel like there should be a way for this to automatically happen as you have indicated above. But perhaps it’s only available in Studio Pro?
This worked Rene! Thank you so much everyone for your responses! Truly appreciate the help! :)