Simple Master-Detail for Employees/Projects

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
FROM project
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:

attribute Value

Display the “New” button in the Grid Open in iframe Iframe

position relative to the main right application.

Iframewidth 360

Tutorials in the same category

Login Form

1- You must create a new application of Control type and configure it as shown in the image below. ...

Contact Form

In this tutorial we will be preparing an application of the Control Form type in which the format w...

Registration Form

Lets' create a registration form. we can follow the steps below: 1- A new control type applicati...

Fields Digital Signature, Select2, Switch and Slider

This example shows the form fields added in Scriptcase version 9.2: Digital Signature, Classificati...

Comment this post