Master Detail Commit Best Practices

1
When using the Master Detail page template, I am unsure of the best practices with regards to editing a record.  Taking the out of the box template, there is a list with editable details on the same page.  The issue I am finding is that when a user changes a record, it updates the record in memory as soon as the change is made to the field.  If a user then selects another record, or something else in the menu, the change stays in memory but is not committed and therefore validations are not enforced.  The list is updated to reflect the change however, since it is updated in memory. This behavior is misleading as a user might think a change has been made, but it is not actually committed to the database until a save button is pressed or equivalent to commit the change. I have seen some examples where the record is displayed as output text in a master-detail, and there is an edit button to display a dialog to edit the record with a proper save button. What is the best approach to implement this functionality?  I would prefer to allow the user the edit the record on the same page as the list, but require a save button to be pressed for validations and commit.  If something else is selected, I would expect a rollback to happen if it hasnt been saved.
asked
1 answers
0

I figured out that you can easily solve this by adding a rule/condition for GroupBox or DataView visibility. This way I simply hide the Details part on my form when the Master part was not saved/committed.

I added:
isNew($currentObject) = false

Now when a new master object is being created, it is not possible to create new detail records until the Save button was pressed first.

Some background / context info…

 

The master/detail form (NewEdit of the newsletterissue):


The conditional visibility for my GroubBox containing Detail grid:

 

The only limitation of this solution is that it is not possible for the user to add Detail objects when the Master object is not saved. This will require the user to Edit the Master object after saving.


The result….

When creating a Newsletter Issue, the Detail objects (Topics in this case) are not available for adding:

When opening the Newsletter Issue for Edit, the Detail grid is shown and the CRUD operations are available:

 

answered