Relations: how modules connect
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.
What is a relation?
Section titled “What is a relation?”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.
- Invoice stores the key
- Purchase order has that key
- 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.
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.
| Type | What Beezr adds |
|---|---|
| One to One | The View Field of the detail record, such as the vendor’s name, in every record of the master module |
| One to Many | A 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.
Where do people see a relation?
Section titled “Where do people see a relation?”- 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.
How do I keep two relations apart?
Section titled “How do I keep two relations apart?”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.
How do I create a relation?
Section titled “How do I create a relation?”- 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
What's next
Last checked