For example, consider a class Contract that has two relation fields.
The first relation field is named firm and refers to objects of the Firm class.
The second relation is named department and refers to objects of the Department class.
On the other hand, a relation on the Department class refers to an object
of the Firm class and then defines the firm to which a department belongs.
<RELATION id="firm">
...
<CLASSES idrefs="Firm"/>
...
</RELATION>
<RELATION id="department">
...
<CLASSES idrefs="Department"/>
<CONTEXT_FIELD idref="firm"/>
...
</RELATION>
The context field defined inside the department field ensure that only departments
that belong to the selected firm are offered to selection to the user.
|