{Header}
This example shows how to implement a master-detail page consisting of grid, record and editable grid forms. The grid form lists all the 'master' records while the record form and editable grid display detail information for a selected master record.
To add a new employee:
To modify an employee's information:
Database: Intranet
Tables: projects, employees, projects_employees
The record form’s Before Show event is used to hide the editable grid if the form is not used for editing an existing record.
The record form’s After Insert event is used to retrieve the last inserted key (emp_id) after a new record is added. The key 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 update the 'project_employees' table after an employee record has been deleted.
The project_id field's On Validate event is used to ensure that the selected projects are unique.
The editable grid’s Before Build Insert event is used to update the hidden 'emp_id' field with the current employee id received over the URL.