baan_player
14th August 2008, 10:35
This related to writing a query.extend using secondary table/non-table fields.

Please have a look at this scenario.

table1
table1.f1 table1.f2
-----------------------
aaa1 aaa2
bbb1 bbb2
ccc1 ccc2
ddd1 ddd2
------------------------


table2
table2.f1 table2.f2
-----------------------
aaa2 aaa3
bbb2 bbb3
ccc2 ccc3
ddd2 ddd3
-----------------------


table3
table3.f1 table3.f2
-----------------------
aaa3 aaa4
bbb3 bbb4
ccc3 ccc4
ddd3 ccc4
----------------------

table1.f2 refers to table2.f1
table2.f2 refers to table3.f1

Now I have a made a display session with table1 as main table and I want to group records based on table3.f2.

My session will show only 3 records:-
aaa1
bbb1
ccc1

(it will be showing only first record of group ccc4 of table3)

Is it possible to write a query.extend using non-main table field??? :confused:

I dont want to use main.table.io section as DAL exists for table1.

Thanks in Advance

ulrich.fuchs
14th August 2008, 13:09
This won't work. As far as I know, the 4GL engine CRUD implementation is always based on the main table, so you can't group (=define view fields) by other tables, even if you can retreive those records using query.extend

sinha_vishwa
19th August 2008, 14:15
Hai,
No buddy,you can't use query.extend here becoz it is used only for the zoom sessions not for fetching data from other tables.
Hope ur problem solved ...

sprasad
22nd August 2008, 15:11
1st of all you cannot use group by in query.extend.
For acheiving your requirement display session should have table3 as main table and table3.f2 should already be in ascending order(you cannot use order by in query.extend).then you should use skip.io() condtionally checking previous and current values in after.read section of main.table.io section by this you will get ccc4 only one then you can select other tables in before.display section and use as set with 1 rows for fetching 1st record.

Hope it will help you.