This topic is locked
[SOLVED]

Lookup Wizard Edit Control Sort

5/18/2025 11:11:02 AM
PHPRunner General questions
J
jaffleck author

Is there any way to specify a custom sort on the lookup wizard dropdown edit control? I have a situation where the displayed item is a combination of a string column and a numeric column (i.e. 'Box 10'). I would llike to be able to specify a multiple sort - item_type,item_number so that Box 2 is listed before Box 10. This requires sorting on one field as a string and the second field as a number.

I use both Version 10.91 and 11.1

Davor GeciDevClub member 5/18/2025

Maybe a workaround, it is not the best, but it should work:

Box 00002
Box 00010

in the Lookup wizard > Edit SQL

SQL:


item_type + ' ' + RIGHT('00000' + CAST(item_number AS VARCHAR), 5) AS sorted_item
J
jaffleck author 5/18/2025

Great idea! I'll give it a try.

It would be a nice addition to allow sorting on multiple fields. (hint, hint!)