Orderby for look up select box

servicenow14710
Tera Expert

Hello developers, i have a scenario where a variable which is lookup select box loading the custom table records needs to sorted by order.

Here is order is a column("u_order" which is integer) in that custom table . so based on u_order the list records has to be sorted .

In variable attributes of the field i gave ref_ac_order_by=u_order which is not workn . can anyone know what the issue here is. Any help is appreciated. Thanks.

9 REPLIES 9

Will try this one as well and let you know how it goes.

Regards,

Siva

@servicenow14710 

simply add this at the end and see if that works

javascript: new ScriptInclude().function()  + '^ORDERBYu_order';

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hello @Ankur Bawiskar :  Thanks for your response, this didnt work , i added the same .  

javascript: new ScriptInclude().function()  + '^ORDERBYu_order';

 

@servicenow14710 

what happens if you simply keep the ORDERBY?

Does it order using that field?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Ankur Bawiskar
Tera Patron
Tera Patron

@servicenow14710 

this older link talks about the same, use the ref qualifier as this and see if that works

javascript: 'ORDERBYu_order';

Reference qualifier "ORDERBY" and javascript does not work 

AnkurBawiskar_0-1744113382369.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader