How can I get a reference field's pick list to display in a sorted order?

HugoFirst
Kilo Sage

How can I get a reference field's pick list to display in a sorted order?

Detail:

On a change request form I have a reference field pointing to another table named u_std_change_list.   U_std_change_list is a custom table and the 2 fields of interest are:
  u_std_change_list_group
  u_std_change_list_item

Both fields display when we click the magnifying glass icon, but the order is random.
We'd like to sort it by u_std_change_list_group and then by u_std_change_list_item.


What we've tried:
After reading http://wiki.servicenow.com/index.php?title=Customizing_Choice_Lists with no help.
Looked at http://wiki.servicenow.com/index.php?title=Dictionary_Attributes and
http://wiki.servicenow.com/index.php?title=Auto-Complete_for_Reference_Fields

We found ref_ac_order_by and ref_sequence.   But neither appears to have an effect.
We tried both, individually,   as attributes on the u_std_change_list table and in the reference field in the form.   No effect was seen at either place.

What am I missing?

5 REPLIES 5

Marik
Kilo Contributor

Steve, I know this is old but just stumbled upon this as I had the same issue.   I had a catalog item reference variable and I needed to sort the selection list that is presented in the pop-up window after clicking the spy glass icon.     I used the ref_ac_order_by attribute and it didn't affect the pop-up list.   After doing a bit more searching I looked where Hugo had recommended and sure enough their is now a dictionary level field attribute "isOrder=true" that allowed sorting of the pop-up list.



http://wiki.servicenow.com/index.php?title=System_Dictionary#Default_sort_order&gsc.tab=0



2.3 Default sort order


The system automatically sorts lists that meet one of the sort order criteria.


  1. If there is a user preference specifying the sort order for the table, the system sorts by the field listed in the user preference.
  2. If the table is the Task table or any of its extensions, the system sorts by the Number field.
  3. If the table contains a field with the attribute isOrder=true, the system sorts by this field.
  4. If the table contains an Order field, the system sorts by this field.
  5. If the table contains a Number field, the system sorts by this field.
  6. If the table contains a Name field, the system sorts by this field.


Thanks for the direction Hugo.




MD