Previous:
Managing Forms
Creating Master-Detail Forms
Master-Detail forms are compound screens that display a top-level
tabular form ("master") along with up to three other
forms below in tabs ("detail" or "child"
forms). The child forms all respond when a user clicks a row
in the master form, and display related record(s) in the child
forms. The master-detail form is a "virtual form"
in that you define each individual form using the standard
Form Designer screen,
then use the Master-Detail Wizard to link any forms you want.
- To create a new form, navigate to Forms > New Form
Wizard in the menu.
- Select the "Master-Detail Form" button.
- Select the Master form and unique column for the form
(usually the primary key).
- Select the detail form and column that relates to your
Master form's unique column (usually a foreign key).
- Optionally specify a second form and related column.
- Now you can create a new menu item using the generated
URL route, open the screen in a new window, or copy the URL to
the clipboard.
Automatically Populating a New Record for Child Form
If you would like to automatically populate a dropdown or text field with the primary key value of the parent (e.g., the parent is a Customer, and when a user creates a new child Order record, you want to automatically populate the Order form's CustomerID for the user), follow these steps:
- In the child Detail form that will support a new record, edit the "Custom CSS" and add a unique class name that will represent that key field. We will use the example 'YOURCUSTOMCLASS'
- Add this code to the child's Header Text or Footer Text:
<script>
$ogidx( document ).ready(function() {
if ($ogidx(".YOURCUSTOMCLASS").val()=='') {
$ogidx(".YOURCUSTOMCLASS").val($ogidx("#parentkey").val());
}
});
</script>
Creating Tabbed Forms
Creating tabbed forms without a master header form is much the
same as the steps described above for Master Detail Forms. Simply
choose the Tabbed Form option in the New Form Wizard and choose
the form you want to display in each tab. Because the forms are
not linked as they are in the Master-Detail, there is no need to
specify a unique column or related columns.