Reference question

0
At Daywize we found something strange with a reference. I have a main entity with a subentity. They have a relation one to many and the subentity will be deleted when the main entity gets deleted. This is the microflow: What the microflow does is creating a new main entity, a new subentity, then set the reference and show a new form with the new created entities. The problem is that it does not show the subentity: The only way to get the subentity to show is to commit this subentity in the microflow. But why do I have to commit this subentity. It should have shown in the form. If you look in postgres as soon as you commit the subentity the main entity is also shown in the database and doing a cancel removes both. But still I would think that the subentity should also have been shown without the commit. Or am I mistaken here? Regards, Ronald
asked
1 answers
1

Datagrids retrieves their data from database (or microflow in 4.x). So until an object is committed in won't be shown in a datagrid.

It's similar to when your are using the new button from the sub entity datagrid. Until you hit the save button it will not be showed in the datagrid.

Try it out: make a custom save button on the sub entity edit form, which don't saves but just refreshes or something. Will also not show anything in the datagrid.

From (database) transactional perspective I share your opinion that is must not be necessary to commit the sub entity. But this is just the way it works in Mendix.

answered