Population rules – fill fields from the record a lookup found¶
Population rules are part of a lookup validation rule. When the lookup finds the record that matches the value of its field, the population rules copy values from that record into further fields of the current record. This page describes their settings and behaviour. It is intended for administrators who configure business rules.
1. At a glance¶
| Purpose | Copies details of the selected lookup record into the current record |
| Typical use | Postcode → city; cost centre → manager and department; product → price and unit |
| Related | Lookup validation rule, Sorting rules |
Population rules are not separate rules. They are edited on the tab "Populate Values" of a lookup validation rule and run only together with it.
2. Settings¶
On the tab "Populate Values":
| Setting | Meaning | Default / required |
|---|---|---|
| "Clear Populated Values" | Applies to all population rules of the lookup rule. "Empties the populated fields whenever this rule does not fill them itself – the field was cleared, no record matches its value, or the rule does not apply." | off |
| "Population Rules" | The list of fields to fill. The + adds a rule; per rule, buttons remove it or move it up or down. | empty |
Per population rule:
| Setting | Meaning | Default / required |
|---|---|---|
| "Field" | The field of the current record that is filled | required |
| "Value" | The expression that computes the value. It is evaluated against the lookup record that was found, so its field references point to fields of the lookup entity. | required |
3. Behaviour¶
Filling¶
- The population rules run when the validated field is set and the lookup finds a matching record – also when "Enforce Validation" is off.
- They run in the order of the list. Each value is a normal field change: it is checked by the validation rules of the target field and can start calculation rules and event based rules.
- A population rule without "Field" or "Value" is skipped.
Giving values back¶
Without "Clear Populated Values", the populated values stay when the validated field is later emptied or set to a value without a matching record. They then belong to a record that is no longer selected.
With "Clear Populated Values", the populated fields are emptied whenever the rule does not fill them itself:
- the validated field was emptied,
- no record matches its new value,
- the lookup rule does not apply to the record (its "Condition" is false).
The fields are emptied before the other validation rules of the same field run. If a second rule fills the same fields, it writes into empty fields and its values win.
Leave the option off when the populated values are only a starting point that users may correct, or when a second rule fills the same fields and its values must survive a change of the validated field.
4. Example¶
Cost centre. Entity Purchase request, lookup validation rule on the field Cost centre against the entity Cost centre (lookup field Code). Population rules:
| "Field" (purchase request) | "Value" (cost centre record) |
|---|---|
| Approver | Manager |
| Department | Department |
Selecting the cost centre 4711 sets Approver to the manager and Department to the department
of cost centre 4711. With "Clear Populated Values" on, emptying the cost centre also empties
both fields.
Why the option matters with two rules. The same field additionally has a list validation rule
with the value NONE for requests without a cost centre. Without "Clear Populated Values",
switching from 4711 to NONE would leave the approver of 4711 in the request. With the option on,
the approver is emptied.
5. Limitations¶
- The values are copied once, at the moment of the selection. If the lookup record changes later – a cost centre gets a new manager – the current record is not updated.
- A populated value that a validation rule of its target field rejects is dropped without a message.