Subforms

One-to-Many Relationships in your applications: Use Subforms

Setting up a one to one relationship is pretty straightforward. All you need is a Lookup field. Here's something that can help you set up one to many relationships in a flash. In one to many relationships, there is a parent form which represents the one side of the relationship and there is a child form which represents the many side of the relationship. The child form is included as a part of the main form and is called a SubForm.

Adding Subforms

Adding another form into your form, just like adding a field

Adding Child Records

Mulitple rows of child records can be added, all at once

Viewing Child Records

A combined view that displays both the parent and child records in one place

Deluge events for Subforms

Other that the regular tasks, there are 2 new tasks, specifically for subforms.

Adding Subforms to your application

While building your customized business applications, you are faced with the need of using a parent child relationship in many cases. Subforms solve this need in minutes. First, build your child form like any other regular form and add all the fields. Then proceed to build the main form. In the main form, just like adding the fields, you can add the subform too. From the left pane, drag and drop the subform field into the form builder area. You can choose a child from from within the same application or from another application.

Adding Child Records

Subforms are inserted into the parent form itself. You can add multiple child records to the subform in one shot. In the access mode, the sub form is displayed in a tabular layout. You can add records to it one after the other by clicking on the "Add New" link. Each record adds a new row in the table. Even while adding the records, you can remove row that you do not wish to add. Not just in the form, even while editing a record, you can add child records to the Subform.

Viewing Child Records

The child records are displayed along with their corresponding parent record in a combined view. In each row, along with the parent records, all the child records associated with it are displayed as links. Clicking the link opens up the child record details in a pop up window. The record summary of the parent record displays all the details of the parent record, as well as that of the child record. Form the view's design mode, users can choose which field from the Subform needs to be displayed in the combined view.

Deluge events for Subforms

Subforms have 2 new dedicated events - On Add Row and On Delete Row. The On Add row event is triggered each time a new child record is added to the parent form. Likewise the On Delete row is triggered each time a child record is deleted from the parent form. Apart from specifying business rules under these events for the subform itself, you can also include workflow for the fields present in the subform. The actions to be executed when a user inputs values in the child form's fields can be specified in the parent form itself.