baanjour
11th April 2007, 19:43
On a display session with main table-A, I have added another field from table-B. Both tables have references. I have added a sort option on table-B.field using query.extend.order("table-B.field"). Everything works fine and I can see the records displayed properly.

As soon as I scroll up or down, I get to see duplicate records displayed on the screen, or the sort is no longer working.

When I trace, from the query passed, I can see that the previous and next records are fetched based on table-A._index1.

In the where condition:
where {table-A.field1, table-A.field2} >= {:table-A.field1, :table-A.field2}
order by table-B.field, table-A._index1

Any ideas...

mostrightfuture
16th April 2007, 15:43
Hi,

The reason for "see duplicate records displayed on the screen" is quite different and not related to the statement "the sort is no longer working".

First, Make it sure the reference between the two tables is correct and quite enough fields are involved in referencing of two tales in to get the correct number of records. It may be the situation that you assume should be only one record return based on the realtion of referencing fields but atcually it is not the case. First resolve this issue and then check for the soriting problem. With the display of duplicate records we should not conclude that the sorting is not longer working. If possible, then first run the same query at database level and check if your recieve the duplicate records or not.

Hope it helps, otherwise we can check other things. Please post the complete query to check the other reasons.

MRF