Picture any grid of a transaction/order/inventory item/etc.
sometimes the object is editable, sometimes because of its STATUS, it should be “locked” and no changes allowed.
sometimes it might depend on the rights of a user wanting to see the object.
But an easy scenario for now…
1) I could have 2 buttons in the grid, and take up 2 columns (which is annoying), and EITHER the Edit or View button will be visible. This could use the built-in View Object & Edit Object buttons and for many things, this is fine in most simple cases.
2) But I’d rather call a Process and let it determine if it does a EDIT Invoice, VIEW Invoice, or VIEW Invoice NOEDIT based on confitions.
3) # 2 works well, and in NOEDIT mode all seems fine (same as in VIEW Object from the Grid), except for Form Sections that show child reference tables. Because now all the Panel Operations are “live”. The NOEDIT mode only controls fields and hiding the SAVE button. But you could still add a new item to the order long after the Order is SHIPPED.
The only way I’ve found to solve this is extra applicability conditions on each Panel operation and on any Buttons you’ve added inside a form. Kinda of a pain.
(ex. Applicable when NOT(Invoice.Status IN ‘Shipped’, ‘Cancelled’, ‘Hold’, etc etc) )
Is there another solution ?
PS _ I’ve added conditions on Section TABs (in a Form) and Panel Operations to be invisible/not applicable when in ADD Mode, rather than make an entirely other “Main” Form Section exclusively for Adds. If so, I check for ID UNDEFINED, or ID < 1, and then I know its in create mode because ID doesn’t have a value yet.