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.

One-to-Many Relation

To create a new relationship:

  1. Click the Setup link in the top right corner of the window.

  2. Select the table you need.

  3. From the setup menu, select Tables > Manage Relations.

  4. Click the New Relation button on the Relations form.

  5. Select the tables to set relations between and click the Next button:
    Selecting Tables For The Relation

  6. Select the type of the new relationship and click the Next button.
    Relation Types

  7. Specify the properties of the master-detail relationship between the selected tables.
    One To Many Relation Form

In the Master-Detail Relation section you can specify the following:

Enter a name that describes the relationship between the two tables.

Master Table Options

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:

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

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.