jeffersyuan
27th November 2006, 08:36
Hi,
For example, tcibd001 hava 2 records and tcibd200 have 2 records too.
tcibd001
item desc
------------------------
A01 Item A01
A02 Item A02
tcibd200
item warehouse
--------------------
A01 W02
A02 W01
I want to make a form display as below
item desc warehouse
---------------------------------------
A01 Item A01 W02
A02 Item A02 W01
So I put query.extend in before.program section:
query.extend.select("tcibd200.cwar")
query.extend.from("tcibd200")
query.extend.where("tcibd001.item = tcibd200.item")
But the result is , A01 can not get the right warehouse. All the item will display same warehouse.
What 's wrong with it?
Jeffers
mr_suleyman
27th November 2006, 12:23
I think that you have display for tcibd001 . Your result is normal.
Try that , add new cwar field into your display . After that in program script
main.table.io:
after.read:
select tcibd200.cwar:cwarfield
from tcibd200
where tcibd200.item=:tcibd001.item
THat s all
Good luck
Dikkie Dik
27th November 2006, 15:32
The advantage of the query extend is:
- less queries
- better performance
So, from that point Jeffers is right. Unfortunatly I have no clue why it doesn't work. Are you sure everything is filled in corectly?
Ïf you don't have the query extend, A01 is showed?
Kind regards,
Dick
jeffersyuan
28th November 2006, 03:03
Hi Dikkie Dik ,
If does not have the query extend, A01 will not showed.
But have the query, Item A01 and Item A02 will have the same warehouse.
So I am very puzzled.
Jeffers
mr_suleyman
28th November 2006, 10:19
Sorry , try following
field.all:
before.display:
select tcibd200.cwar:cwarfield
from tcibd200
where tcibd200.item=:tcibd001.item
That's all
bigjack
28th November 2006, 11:29
Hi,
Its a problem which was faced by me few months back. Apparently the description is picked from last record or first record on form. If you do a pagedown (provided you have many records) the description will change but still it will show the new description for all of them. Seems like the LN session can't treat the new field which is added as multioccurence field. For LN the description field is a field with only 1 occurence.
If you change the session from multioccurence to single occurence the description is displayed correctly.
The only solution i found was to avoid query extensions and use old method of displaying descriptions by coding the logic in before.display subsection of the warehouse field.
Bye
en@frrom
29th November 2006, 11:15
I found the same behaviour in the past, and am also using the method of a seperate query for the field per record in a multi-occ display session. Am curious to know if anyone succeeded using query.extend...