Sorting by related field problem

Hi there,

  1. Lets say I have a table client and table address. There is a relationship client_to_address. Client can have many addresses (i.e. 10 addresses for each client).

  2. Lets say I have 2 clients in my found set and I want to sort then my client_to_address.PostalCode field. When I do this sort Im getting 20 record in my found set (not 2 but 20) . Its still those 2 clients, but why they are repeated x10 times each.

If user is trying to sort 2 clients by addresses, he or she is expecting to end up with 2 clients sorted by client_to_address.PostalCode.

Am I doing something wrong?

Thanks
Pavel

I’ve seen strange repititions like this in portals and/or tab panels that were usually to my trying to do something odd. Are you limiting the number of addresses by exactly 10 somehow? Are you using a tab panel or portal? Are you using addFoundSetFilterParam? Need more info to help.

Hi Bob,

The Client form has a related tab panel with address form.

No i’m not limiting the number of records in any way, it can be whatever.

I’m not using the addFoundSetFilterParam at all.

Thanks for you help

I have a hunch. Please post the method(s) you trigger for the sort.

Well i’m just trying to sort it with the servoy sort(in the menu), in other word i don’t have a method for sort.

Come to think of it, you can’t sort through a relationship as of 2.2rc2. You can try setting the initialSort property of your portal, but this never worked for me. I’ve found tabless tab panels are easier to control for this type of stuff though it does take a bit more effort to set up.