I had a table query that was using search and order_by to sortby multiple fields. Originally the “product_name” field was a text field and this order_by was working fine. After I updated the “product_name” field to be a link field, the order_by stopped working. I guess this is because the ‘product_name’ is now returning a row instead of text. How can I get my order_by back up and working again?
The tables are set up as follows:
app_tables.railcars:
railcar_number - text
shipment_id - text
product_name - link
seal_numbers - text
I don’t know that there is a way to do this without the use of a lookup column
For example if your linked row has a column called name and this what you wanted to sort by, then create a name column in your ‘rail car’ table called name with that value and then sort using that text column.
This would make a nice Feature request though if it hasn’t already been done.
If you are completely consuming the iterator, that is if you are using all the rows returned by the search, then you can sort them in memory with the sorted python function.
Using the sorted function with the standard tables could be slow, because it will trigger a round trip to the database server per linked row, while with the accelerated tables it should be very fast, because you can cache all the linked fields during the search.