Build a customers and orders database
Create two linked tables for customers and their orders, with order numbers and statuses.
Questa pagina non è ancora tradotta. Stai leggendo l’originale.
In questa pagina
This recipe builds a small sales database: a Customers table and an Orders table where each order belongs to a customer.
1. Create the Customers table
1. Options > Create table.
2. Pluralized name Customers, Singular Customer, Tab Sales, Category Contacts.
3. Click Name in the columns and rename it to Company.
4. Add the columns:
Email, type Email.Phone, type Phone.Country, type Dropdown, with the itemsSpain,SlovakiaandGermany.Active, type Checkbox.
5. Click SUBMIT.
2. Create the Orders table
1. Options > Create table.
2. Pluralized name Orders, Singular Order, Tab Sales, Category Orders.
3. Rename Name to Subject.
4. Add the columns:
Number, type Auto increment, formatyyyy####.Customer, type Table, table Customers. Check Required and Show link button, and set Render items in all related tables to As list.Order date, type Date.Amount, type Number, with Decimals2and Format{0} EUR.Status, type Dropdown, with the itemsNew,PaidandShipped.
5. Check Enable versioning, so every change of an order is kept.
6. Click SUBMIT.
3. Add data
- Click Add on the Customers card and create a few customers.
- Click Add on the Orders card, choose a customer and save.
Each order gets the next number, 20260001, 20260002 and so on. The detail of a customer lists its orders.
4. Make it easier to read
- In the Formatting tab of Orders, add the condition
row.x04 > 1000with Bold to highlight large orders. Use the ID of your Amount column. See Conditional formatting. - Filter the orders by a customer and save the filter as a view.