ORDERBY is not working for Lookup select box in service portal

rmunjal
Mega Explorer

Hi Team,

I have one catalog item where in I am using one lookup select box variable. I want the choices to be sorted out based upon on the department field in the reference table I am using for lookup.
I have used below code in advance qualifier of this lookup variable

javascript:getRequestType()

and this is refering to script include

script include

function getRequestType()

{

var query = 'u_parent='+current.variables.Application_Component+'^u_active=true'+'^u_service_request=cc00174a4f252b404c73cf5d0210c7e3'+'^ORDERBYu_department';

return query;
}

This is working perfectly fine in internal servicenow. However, not working on service portal. Please help me to fix this issue.

11 REPLIES 11

L_10
Kilo Contributor

My co-worker asked someone, and got this answer.

Looks like the setting change in UI Properties may have worked.


>1. Navigate to System Properties > UI Properties. 
>2. Locate the property Allow base table lists (task, cmdb_ci, etc.) to include extended table fields (incident_state, os_version, etc.), and allow filtering on extended table fields (glide.ui.list.allow_extended_fields). 
>3. Select the check box to enable extended fields on base table lists. Clear the check box to disable the feature. 
>4. Click Save.
 
https://docs.servicenow.com/bundle/london-platform-administration/page/administer/list-administration/task/t_ConfigureTheListLayout.html

satyendrakgupta
Tera Guru

Do not do anything in the Variable Attributes section of the "Lookup Select Box", in place of that update the "Reference qual" of the varible as below--

ORDERBYu_sequence

where u_sequence should be your "Column Name" by which you want to short.