Creating Relations
Suppose in your database, you have created a table called "Projects," which contains information about projects, and the "Clients" table, where clients’ profiles are stored. Every project is ordered by a client; some clients order many projects or make repeat orders. To link the Projects and Clients, you need to create a relationship between these tables.
To create a new relationship:
-
Click the
Setup
link in the top right corner of the window. -
Select the table you need.
-
From the setup menu, select
Tables
>Manage Relations
. -
Click the
New Relation
button on the Relations form. -
Select the tables to set relations between and click the Next button:
-
Select the type of the new relationship and click the Next button.
-
Specify the properties of the master-detail relationship between the selected tables.
In the Master-Detail Relation
section you can specify the following:
- Name
- Enter a name that describes the relationship between the two tables.
Master Table Options
- Table
- This field displays the master table name.
- Key Column
- Here, the master table key column is displayed.
- Proxy Column
- Use the Proxy Column to specify that another field containing a more accurate description should look and act like the reference field when you view a record’s data on the View Form.
- Record Picker
- The Record Picker section defines how the master table records will be organized for the reference column of the details table:
- Simple Choices if values should be accessible via a drop-down list;
- Dropdown with ‘Browse Choices’ option if values should be selected from the browse window, not from the drop-down list (for more information, see the Record Picker section);
- Type-in with ‘Search’ button to enable search for the reference field of the details column.
The Default Record Picker Options are applied to the reference column by default. You can set the default record picker according to your needs, but there may be cases when such a default option should be overridden. To set the specific record picker option, check the Override default record picker
checkbox (for more information, see the Record Picker section).
Detail Table Options
- Table
- This field displays the detail table name.
- Reference Column
- Select the name of the Reference column. A reference column is a column in the detail table containing a link (a reference) to a master table record.
- Details View
- Select a view in the list to see records from the detail table below the master table view form (for more information, see the Displaying Details section).
- Alternative Name
- Enter an alternative name for the detail table records block (for more information, read the Displaying Details section).
If a relationship between tables is deleted, the reference column will still be present in the detail table. You can delete this column from the column listing, just select
Columns
>Customize existing columns
link.