Kushal Tutorials - Document

Kushal Help| Parent-Child Detail Only Save Entry Form

Parent-Child Detail-Only Save Entry:

Parent-Child Detail Entry-Only save form helps you to perform data manipulation on the selected table pair with controls internally mapping to the Data Grid. In this form one table is considered as a parent table and another one as a child table. Capturing Parent and Child Table information in one form is a common requirement in most of the database applications.

This form helps in saving both the parent and child entries in a single click rather than the Parent child detail entry form where you require to save the child entry details first and then save the Parent entry details.

For example, Bill information will be saved in 2 tables, Bill Master and Bill Details. Bill master to store Party Name, Bill Number, Bill Date, Total Amount etc. and Bill child table to store multiple product information. On click of save, both the Parent and child data entries will be saved.

This form will represent all fields of the parent and child tables with different types of controls depending on the field's datatype. The data is displayed over 2 data grids, in which one grid refers to the parent table while another refers to the child table. Buttons which are having predefined actions like New, Save, Delete, Search, Export, Close for parent table operation, as well as Add, Update, Remove for child table operation are set. The Update action is provided in case required but, even on click Save action, entire form details will be saved.



Note: Kushal expects users to follow database design guidelines for making applications work.

For example, single primary key for parent table and composite primary key for child table.

Bill Master

Id int(10) PK

Bill Detail

Id int(10) PK

bill_Id int(10) PK , FK(Bill Master)

To create a Parent-Child Detail Entry form

Click on New Form button.



Select Form type as Parent Child -Detail Entry-Only Save.



Select Parent Table Name in the drop-down (Dropdown lists all tables from given database details)



Select the Primary Key Field.



Kushal automatically identifies the Primary Key Field from the table as defined in the database and it sets the primary key. In Kushal Primary key gets auto-incremented if it is of integer data type.



Kushal automatically identifies the Sort field from the table as defined in the database and it sets the primary key. Sort Field can be selected from the Dropdown as shown below.



Select Child Table Name in the drop-down. (Drop-down lists all tables from given database details)



Select the Primary Key Field.



Select the Foreign Key Field (Which is having a relation on parent table)



Select the Sort Key Field.



Check Use Title-Case [Link] to display the Table name in Title case.



CheckExclude table name in field names generated in new forms [Link] to exclude Table Name.



Click on Create button.



Kushal will create the User interface of the form on selected Tables automatically. Further, you can modify the controls as per your requirement.



In Parent-Child Detail Entry Form, Kushal takes care of input validation in both parent and child tables including, auto-incrementing of the primary key, deleting a selected record, exporting data to excel, data manipulating and other validation/checks on data grid cells (which may be added by you). Whenever you enter the data on parent table input controls and child Data Grid, Kushal maps the foreign key and primary key to child records while performing save action. In addition to this, when you select the parent record, consequently in child grid you will get filtered data mapped to the parent.