AnsweredAssumed Answered

How do I change the sort order of a value list that comes from a related table?

Question asked by gczychi on Jul 17, 2011
Latest reply on Jul 18, 2011 by philmodjunk

Title

How do I change the sort order of a value list that comes from a related table?

Post

Hi,

I have two tables, that are related by an ID field. table 1 looks like this:

ID Textfield AnotherTextfield

1       ...         zzz

2       ...         bbb

3       ...         mmm

table 2 looks like this:

ID aField table1_ID Table1::AnotherTextField

1      …         3         => displays «mmm» from table 1

2               1         => displays «zzz» from table 1

3               2         => displays «bbb» from table 1

To enter the correct IDs in table 2 that refer to the records in table 1, I have defined a drop down menu that shows the IDs of table 1 and as the second value it shows the values of AnotherTextField from Table1.

Everything works as expected except for the value list. It is sorted by the first value «ID» and I want to have it sorted by the second value «AnotherTextField».  There are more than hundred records in table 1, and it is very difficult to choose the correct record when the list is not sorted by the AnotherTextField.

Is there any way to sort the drop down value list by the second field?

Thanks a lot for any help,

Gary

Outcomes