To sort name field by last name

shraddhap
Tera Expert

Hello,

We have modified the Name field on sys_user table to return "Last name, first name" but when we sort on name field column its sorting by first name.

Sorting works fine for newly created users but for old records its sorting by first name. Any suggestion?

Regards,

Shraddha

1 ACCEPTED SOLUTION

Hello Shloke,



Thanks for the reply, I tried using ASC but still it was not working. So, I did this in an another way, as sort was not working for old user records and in order to make it work for old user entries as well , have created a background script to update all active users for old user records.



So, created a new field as "User Sort" on user table and set the default value as "True",using background script I have set the value as false and now it works fine.



Regards,


Shraddha


View solution in original post

6 REPLIES 6

shloke04
Kilo Patron

Hi,



Write a Before Query Business Rule on the table you want as mentioned below:



find_real_file.png



Replace sys_created_on with your field name and select the table in the BR on which you want to apply.



Hope this helps.Mark the answer as correct/helpful based on impact.



Regards,


Shloke


Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Thank you Shloke, but it is partially working. Works fine for descending order but doesn't works for ascending order.


Hi,



The above script shared by me will work one way itself as we are using "desc",the above BR forcefully sorts the list column in descending order.



To have it in ascending you need to use another BR and use asc in place od desc.



Hope this helps.Mark the answer as correct/helpful based on impact.



Regards,


Shloke


Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hello Shloke,



Thanks for the reply, I tried using ASC but still it was not working. So, I did this in an another way, as sort was not working for old user records and in order to make it work for old user entries as well , have created a background script to update all active users for old user records.



So, created a new field as "User Sort" on user table and set the default value as "True",using background script I have set the value as false and now it works fine.



Regards,


Shraddha