{Header}
This example shows how to create a master-detail order entry page. A grid form is used to display a list of all the orders while a record and editable grid form display detailed information about a selected order.
To add a new order:
To edit an order:
To modify the order information:
To modify the order items
Database: Intranet
Tables: customers, orders, order_items
The record form's Before Show event is used to hide the editable grid if there are no orders selected.
The record form's After Insert event is used to retrieve the last inserted key (order_id) after the order record is created. The retrieved value is then sent over the URL by appending it to the 'redirect' variable as a URL parameter.
The record form's Before Delete event is used to delete records from the 'order_items' table whenever an order record is deleted.
The editable grid's Before Show Row event is used to fill the id, name and style attributes of the <TR> tag depending on whether the row is empty or filled.
The editable grid's Before Build Insert event is used to update the hidden 'order_id' field with the current order id.
The Before Show event of the 'PriceArray' Label is used to create an array with the product prices that will be used to auto fill the 'Price' Text Box.