In this “how to” tutorial, you will create a simple master / detail application. Three applications are used: a Grid (to list employees), a Form (to edit the employee) and a Form of the Editable Grid type (to edit employee details).
Creating the Editable Grid View form (detail)
1. Create a new Editable Grid View application using the Employeeprojects table.
2. Click on Field Positioning.
3. Remove the EmployeeID field.
4. Open the Fields option in the menu and click on ProjectID.
5. Change the type of data to Select.
6. Open the Lookup Edit tab.
7. Add the follow SQL Statement:
|SELECT ProjectID, ProjectName |
ORDER BY ProjectID
8. Change Allow negative value to Yes.
9. Click generate source code in the ScriptCase toolbar.
Creating the employee form (Master).
10. Create a new form application using the employee table.
11. In Settings, change Table Width to 350 and Table Width to Pixel.
12. Open the Select fields folder in the menu, delete all fields on the right side, except the Firstname.
13. Add a value to the EmployeeID field. Click Edit Fields.
14. In EmployeeID select the increment option (Automatic).
15. Open the Layout folder in the menu and click Blocks.
16. Change the attributes of the block according to the image below:
Creating the Master / Detail relationship (linking the created applications)
17. Open the Master Form / Detail folder in the menu and click on New Detail
18. Rename and label on the right side. Click on the Create button.
19. Select the detail form (the form created in the previous steps) and click Next.
20. Link the EmployeeID field from one form to another. To finish click on Save.
21. Click generate source code in the ScriptCase toolbar.
Creating an employee grid.
22. Create a new grid application using the employees in the table.
23. Change the width of the table to 600 and the unit of the width of the table to pixel.
24. Click Select Fields, delete all fields except EmployeeID and FirstName.
Linking the Grid with the Form (teacher)
25. Open the Link folder in the menu and click on New Link.
26. Click Create new link to start the wizard.
27. Select the application in the link type and click Next.
28. Select the master form created above and click Next.
29. Link the EmployeeID fields of the form to EmployeeID from the grid.
30. Change the attributes of the link according to the table below:
Display the “New” button in the Grid Open in iframe Iframe
position relative to the main right application.