Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

Regarding the sorting function for embedded lists

bonsai
Mega Sage

I am displaying information configured via relationship records in "embedded lists."
To sort the displayed information, I have set `current.orderBy("field_name");` in the relationship record.

However, when displayed in an embedded list, the list cannot be sorted.

In contrast, when the relationship record information is displayed in a related list, the sorting can be changed.
Is there a way to enable sorting changes in embedded lists as well?

3 REPLIES 3

SVimes
Mega Sage

Have you considered either adding global user preferences to sort such that you have:

  • <table>.db.order = <field_name>
  • <table>.db.order.direction = DESC or no value
Sable Vimes - CSA | CAD | CIS-DF | CIS-ITSM

On which table and how can this be configured?

Sorry for the delay. I had an exam last week. This is in the User Preferences table (sys_user_preference). When users update their preferences, you will see these records created and updated. The ones I mentioned are from clicking a table column header to sort what I'm looking at and would have my user as the one that preference applies to. You can create a system-wide default by creating the preference, set System to TRUE, and leave the User blank.

 

For reference - User Preferences Documentation 

Sable Vimes - CSA | CAD | CIS-DF | CIS-ITSM