Hello
I get wrong results when doing a Find in a field which is is on the form (to search) via a relation to another table.
How is it possible to search in a field on a form which is not directly a column of the underlying table but fetched via a relation from another table? That should work, should it?
Best regards, Robert
Servoy Developer
Version 3.5.6-build 519
Java version 1.5.0_13-121 (Mac OS X)
PostgreSQL 8.2.5
Robert,
That should definitely work, in what way are the results wrong?
The query generated should be
select main.pk from main [ left outer ] join related on where related.field =
Rob
Hi Robert
I think I made a consideration error. If the related field is to 1 related field, it should work and it seems so in my tests. If the field is to m related, I assume it can’t work. What will Servoy display if I searched this way and are going to scroll on the form. i. e. the 1-side of the searched field? May be just the “top” record on the m-side? What if some sorting is set as well…
So I would say it is for many cases not appropriate to search on a related field.
What is your opinion? May be there is even a report somerwhere where somebody thought about that in detail?
Thanks for your answer and best regards, Robert
rgansevles:
Robert,
That should definitely work, in what way are the results wrong?
The query generated should be
select main.pk from main [ left outer ] join related on where related.field =
Rob
Robert,
Find on a form is always searching for the PK of the main table on the form, and displaying data related to that PK.
For instance you have an orders form and are showing order details in a related tab, a search for order_to_orderdetails.product_id = 10 would find all orders that have 1 or more details with product_id 10.
From these orders all order details (also the order_details with product_id 11) will be shown in the related tab.
Hope this helps,
Rob