Tip #469: Sorting lookup field quick preview

Most of the time Joel is very helpful but sometimes he’s just plain grumpy:

I’m finding that the lookup field quick preview list does not honor sort order. In this example I have a “sequence” field that sorts the list in the desired order:

Screenshot 2015-09-02 21.09.07

If you go to the lookup dialog, it honors the sort order in the lookup view:

Screenshot 2015-09-02 21.09.22

Is there any way to make the quick lookup preview honor the sort order?

And I kind of appreciate his grumpiness on this one because the reply from authoritative sources came thick and fast:

This is not possible today, quick preview list sorts it based on the “primary attribute” of the entity. But if this is something which blocks your scenario, I will be happy to add it into the backlog for lookup enhancements. Can you please open a connect bug for this and send me the ID.

Relentless man that he is, Joel indeed used Microsoft Connect to press on with the issue (and under the similar circumstances you, our readers, should do the same!):

Here is an existing Connect item with 15 votes. I would say this is high priority. The only way to make it work is currently to append numbers to the lookup list to make it sort correctly in preview.

Screenshot 2015-09-02 21.13.13

11 thoughts on “Tip #469: Sorting lookup field quick preview

  1. Brandon says:

    I get a “page not found” error when I try to go to the existing Connect item.

  2. AdamV says:

    Up to 43 votes and counting…

  3. Mike says:

    Was there ever a resolution for this?

  4. Mike says:

    Did MS ever fix this issue?

  5. Travis says:

    function sortDescending(a,b){
    return $(a).find(‘.ms-crm-IL-MenuItem-MoreInfoItem[colname=”yyy”]’).text() <= $(b).find('.ms-crm-IL-MenuItem-MoreInfoItem[colname="yyy"]').text() ? 1 : -1;

    parent.$('#zzz_IMenu .ms-crm-IL-MenuItem:not(.ms-crm-IL-MenuItem-Lookupmore-Rest)').sort(sortDescending).prependTo('#zzz_IMenu');

    This is the unsupported way of resorting the results window.

  6. Jiri Cabal says:

    Current link to the Dynamics Ideas (new Connect):
    Now, 70 votes-up, status Planned Mid Term for 4 years.

  7. Arti Madhave says:

    this link is not working anymore (point somewhere else) https://experience.dynamics.com/ideas/idea/?idea=812355.
    Please can someone paste the latest link here?

Leave a Reply

Your email address will not be published. Required fields are marked *