Table relations and the fields a lookup shows
Instead of a fixed list you can let a code slot take its values from another table — a salesperson, a location, a customer, an item. The user then picks a record from a lookup, and the app stores the value of one field of that record.
Before you start: you need a code slot, and you must know which table the values come from and which of its fields the value must match. On Field Setups the slot gets Type Table Relation, Table Relation with the number of the table — for example 13, Salesperson/Purchaser — and Field Relation with the field the value must match, for example Code.
Choose the fields the lookup shows
- On Field Setups, select the relation row and choose Relation Visible Fields.
- Choose Add Fields. Field Lookup opens with every field of the relation table: No., Field Caption, Type Name and Len.
- Select the fields a user needs to recognise a record — for example Code and Name — and confirm.
- The fields appear on Relation Visible Fields and, from now on, as the columns of the lookup. Table Rel. Visible Field on the field setup is on.
- At most 10 fields can be shown per relation table. To stop showing one, select it on Relation Visible Fields and choose Remove Field.

Example. The administrator sets up Account manager in Code 2 (5750001) of the Customer table: Table Relation 13 (Salesperson/Purchaser), Field Relation Code, visible fields Code and Name. On the Customer Card of 10000 Adatum Corporation the user opens the lookup and picks JD — Sales Administrator.
What happens. The lookup shows the relation table's records with the columns you chose, in the order of the table's field numbers. Picking a record writes its Field Relation value into the slot. A value that does not exist in the relation table is refused when it is typed.
Note: Values that were stored before you changed the relation or its visible fields are not checked again. The app never rewrites data behind your back.
If something goes wrong
| What you see | Why | What to do |
|---|---|---|
| Field Unit Price of table 27 cannot be used for a table relation. | The field you named cannot hold a code — it is a decimal, a date or another type that does not fit a code slot. | Choose a field of type Code, Text, Integer or Option. |
| You can select at most 10 visible fields for table 13. | The lookup already shows ten fields. | Remove a field with Remove Field before adding another. |
| Value SMITH does not exist in field Code of table 13. | The value typed into the field is not in the relation table. | Pick a record with the ... button, or type an existing code. |
