Custom field not sorting correct

When sorting ascending/descending a custom field column the empty fields stay at the bottom of the list.

Desktop - W10 - V. 18.11.61

Illustrate what you mean with screen shots.

Screenshot%20of%20Northwind%20Traders%20(05%20Jul%202016)%20-%20Verkooporders%20descending

As you can see the empty custom (Status) field stays at the bottom. This Status-field is a custom field on sales-orders records.

Custom fields are text, not numbers. When there is no text, it isn’t sorted.

I understand, but it’s not very convenient.

Then don’t leave the field blank.

In real life i use a date field (which are also sorted as text) for when an sale-order is completely finished so i can see in one eye view which orders are completed and which aren’t. The easiest way to do this is to just leave it blank otherwise i have to put a date in that filed (an extra handling) and also, in the overview, the not finished orders are much easier to spot when this field is blank.
The way it sorts now is not the most logic way (unless your’e a programmer) so if it could be changed, it would enhance Manager.

No, they are not. Date fields are sorted as dates. But empty fields remain at the end, consistent with sorting of text field types, because there is nothing to sort.

I wonder why you think an empty field belongs at the top (or bottom) of a list when the sort order is changed. The fact is, in the situation you have described, you are not desiring a sort by date. You are desiring to sort by a graphic characteristic of a table cell (emptiness). How can you expect the program to do that? It is far more intuitive, when field content is optional as in your case, to assume that when a user sorts by a field heading, the records with content in that field would be shown at the top. If those were not the records of interest, why sort on that heading?

If you want to know which sales orders are open, a better approach would be to create a list-type custom field, setting the “Open” option as the default under Form Defaults. You can even use HTML to change the different status options different colors. (I posted an example of this on the forum many months ago.) Then, when sorting on the Status column, all the open orders will be together. With a little creativity, you can choose list options that will alphabetize conveniently in your language.

Thank you for pointing out the obvious. I’m not a native English speaker (as you probably already knew)

Piece of cake, any programmer know how to sort a empty field. Ask @lubos

I don’t agree. With a date i know not only if but also when a order is closed. Something to do with two birds and one stone.

If I understand well [Status] is a custom field of a date type.
Maybe a workaround could be:

  • go to [Settings], [Form defaults], [Sales order] and give the custom field [Status] a date like 01-01-2001
    This way, opening a new sales order will have the [Status] field filled with 01-01-2001 by standard.
    Indeed, not empty, but maybe usefull.
1 Like

FYI

You are right, @Frankie. I forgot that HTML cannot be applied for elements within a dropdown list. I was remembering a technique for single-line text custom fields explained in this post: Changing colour of text in drop down menu - #2 by Tut.

The rest of my comment is valid, however. You can set up the dropdown list and set a default condition under Form Defaults.