I don’t seem to understand how this works. Let’s say I have two relations: customers_to_orders and orders_to_order_details. If I have a form based on customers, and a tabpanel with the relation customers_to_orders.orders_to_order_details, then a tableview form in that tabpanel should show all order details for all orders for the selected customer, correct? But it only shows the order details for first order for that customer. What am I doing wrong?
Relations are 1-to-many, not many-to-many, so you will get all the order_details of the selected order.
Paul
You can achive what you need in the following way :
-
define a relation order_details_to_orders (on order_id)
-
in customer detail form create an unrelated tabpanel containing the order_detail tableview form
-
in the onRecordSelection event for the customer detail form include the following :
function onRecordSelection(event) {
forms.order_details_lista.controller.loadAllRecords()
forms.order_details_lista.controller.find()
forms.order_details_lista.order_details_to_orders.customerid=customerid
forms.order_details_lista.controller.search()
}
where order_details_lista is the name of the order_detail tableview form.
In this way you are filtering the order_details records using a column that is not part of the table but accesible thru a relation.
I guess linked relations are more useful to obtain a single record as a result, using mostly many-to-1 relations in the linking (but may be someone can tell more about it).
Interesting, thank you very much.