Skip to content

Relations: how modules connect

Concept6 minPractitioner

Before you start

A relationRelationA link between modules.Open glossary ↗ connects two modules so that a record in one can point to a record in the other. An invoice points to its purchase order. A contract points to its vendor. You set the link once, and people then pick the related record from a list.

Every relation has two sides.

  • The master module holds the link. Each of its records stores the key of one record in the other module. Invoices are the master when each invoice stores its purchase order.
  • The detail module is the one the link points to, here Purchase Orders.

The Relations manager uses the words Master and Detail. The Fields page calls the same things the module you are in and the Related module.

  1. Invoice stores the key
  2. Purchase order has that key
  3. Invoice shows the order's name

The stored value is the key fieldKey fieldThe module’s identifying field.Open glossary ↗ of the detail module. That is why a relation field takes the name of the related module’s key field, for example purchase_order_pr_id.

The Fields page for Invoices. Two Relation fields, Purchase Order and Contract, sit among the other fields, each named after the key field of the related module.
    A Relation field links each invoice to a purchase order.
    A second Relation field links the same invoices to a contract.
    The key icon marks the key field of Invoices itself.

Should I choose One to One or One to Many?

Section titled “Should I choose One to One or One to Many?”

The relation type decides what Beezr adds around the link.

TypeWhat Beezr adds
One to OneThe View Field of the detail record, such as the vendor’s name, in every record of the master module
One to ManyA related tab on the detail record’s page, listing the master records that point to it

Choose One to One when people need to see a value from the other record in lists and forms. Choose One to Many when you mostly want the other direction: a purchase order page with the invoices raised against it.

The Relation button on the Fields page creates One to One relations. Use the Relations manager to choose One to Many.

  • In lists and on forms, as the value of the View Field (One to One).
  • On the detail record’s page, as a related tab, for both types. You can order and hide these tabs in the Smart view designer. See Add related tabs.

When two relations on one module show a field with the same name, such as name, give each a different View Alias in the Relations manager, for example vendor_name and buyer_name. Each relation then keeps its own value in the record.

  • From the Fields page, follow Add a relation. It creates the relation and its Relation field together.
  • To list, edit or delete relations, or to choose One to Many, use the Relations manager.

Check yourself

Invoices hold a link to Purchase Orders. In the Relations manager, which module is the master?
Show the answer

Invoices, because its records hold the link. The master module holds the key of a record in the detail module. Invoices store the purchase order they belong to.

Which relation type brings a View Field value, such as the vendor's name, into every record of the master module?
Show the answer

One to One. One to One adds the View Field of the detail record to each master record. One to Many gives the detail record a related tab.

What's next

Last checked