This post is the continuation of our Advanced Master/Detail tutorial. Click here to read the first part of the tutorial.
Once the master is created it is time to create the detail form.
Creating a Detail Form:
1 – Create a new form of the type Editable grid view based on the table order_details.
2 – On the application menu, click on the field positioning.
3 – Remove the fields OrderDetailsID and OrderID.
4 – On the application menu click on Fields and select the field ProductID.
5 – Change to Data type of the field to Select.
6 – Still on the field ProductID go to the Lookup Settings, On the SQL Select Statement insert the following Query of the image:
7 – Still in Fields on the application menu click on New Field.
8 – Create only one field, then click next.
9 – Change the type to Decimal, Name and Label to Total.
Creating methods in the Detail Form.
10 – On the application menu access the programming tab, then expand PHP Methods -> New Method.
11 – Create a new method called calculate_total.
12 – Insert the code from the following image:
13 – Create a new method called check_stock.
14 – Insert the code from the following image:
15 – Create a new method called update_master.
16 – Insert the code from the following image:
Tomorrow we will post the third and last part of the Advanced Master/Detail tutorial.
Read the fist part of this tutorial. LINK HERE
To read the 3rd and last part of this tutorial click here
Learn more about this and other features that Scripcase offers. Do you already know Scriptcase? Download the free version of our tool and discover a world of new possibilities.
To know a little bit more about Scriptcase Master/Detail feature don’t miss our Q&A Webinar about “Advanced Master/Detail on Scriptcase”on next Friday (June 06th), click on this link to register.