reference qualifier to sort a reference field

vibee
Kilo Expert

Hi,

I am trying to sort a reference field on a catalog item that I have. I need to globally default sort the results of the ref field when they go to the pop up and look at the referenced table.

I have tried a reference qualifier, but that is not working for me. Can anyone suggest what I am doing wrong and how to get it to work.

I need to the u_user_position field by the u_order field. The requirement was to have a specific order the u_user_position field items need to be, which is not alphabetical. So I created an Order field that is hidden on the list view, and reference field view to use as the value to use to sort the u_user_position field.

This was the ref. qualifier I tried on the reference field variable: u_user_position=u_order^ORDERBYvalue       and   u_userposition=u_order^ORDERBYu_order     and u_user_position=u_order^ORDERBYu_user_position

1 ACCEPTED SOLUTION

OK. I'm glad you got it figured out.


View solution in original post

7 REPLIES 7

OK. I'm glad you got it figured out.


How do we make this work on the Service Portal?

hickoryal
Giga Contributor

I have a lookup select box that should take a value from a variable on the catalog item and display SubCategory in the order defined on another field SubCategoryOrder defined on my category table.


Reference Qualifier:
javascript:'CategoryName=' + current.variables.varCategoryName

Display Field : SubCategory

Sort order: SubCategoryOrder

 

Sort works if I hard-code the value of CategoryName in reference Qualifier.

ORDERBYSubCategoryOrder^uCategoryName=ABCCategory

But here I am getting the CategoryName from another variable called varCategoryName.

So, I had to use javascript.  When javascript is used, ORDER BY does not work.

 

This is what I tried by putting in ReferenceQual:

ORDERBYSubCategoryOrder^CategoryName=Cat1 : sort works but Cat1 is hard coded.
ORDERBYSubCategoryOrder^CategoryName=current.variables.varCategoryName  : This does not work for obvious reason 
ORDERBYSubCategoryOrder^javascript:'CategoryName=Cat1' :  all values appear from the table and they are not sorted.
ORDERBYSubCategoryOrder^CategoryName=javascript:current.variables.varCategoryName : no rows

 

Any help is much appreciated.