CoreBOSBB
Related lists: can we set a default sort order? - Printable Version

+- CoreBOSBB (https://discussions.corebos.org)
+-- Forum: Support (https://discussions.corebos.org/forumdisplay.php?fid=17)
+--- Forum: Administrator Support (https://discussions.corebos.org/forumdisplay.php?fid=8)
+--- Thread: Related lists: can we set a default sort order? (/showthread.php?tid=2356)



Related lists: can we set a default sort order? - Guido1982 - 06-15-2022

I'm setting up some 'ListColumns' business maps, where I include the createdtime columns in each to bypass the dreaded record numbering, which doesn't allow us to sort (so we sort on createdtime to kind of get to the same goal). What I was wondering is: can I set that default sorting for related lists somewhere? Right now, it goes from old to new, where the oldest ones appear first (at the top) of the list. I would like to reverse that default order, or set some other custom ordering. Can that be set somewhere?


RE: Related lists: can we set a default sort order? - joebordes - 06-15-2022

https://discussions.corebos.org/documentation/doku.php?id=en:devel:develtips#modify_record_default_view_ord

https://discussions.corebos.org/documentation/doku.php?id=en:adminmanual:faq#automatic_number_fields_are_no

HTH


RE: Related lists: can we set a default sort order? - Guido1982 - 06-15-2022

Well changing the code to core modules won't make it very upgradeable right? Is there no other solution?


RE: Related lists: can we set a default sort order? - joebordes - 06-15-2022

I sent that so you could see the GV that is defined there LISTVIEW_DEFAULT_SORTING


RE: Related lists: can we set a default sort order? - Guido1982 - 06-15-2022

Aaaah, sorry, misunderstood that part.

OK so I've set the following Global Variables:
  • Application_ListView_Default_Sort_Order
    • Value DESC
    • Default 'yes'
    • Mandatory 'yes'
    • Selected all modules and 'In module list' to 'yes'
  • Application_ListView_Default_Sorting
    • Value 1
    • Default 'yes'
    • Mandatory 'yes'
    • Selected all modules and 'In module list' to 'yes'
  • Application_ListView_Default_OrderField
    • Value 'createdtime'
    • Default 'yes'
    • Mandatory 'yes'
    • Selected all modules and 'In module list' to 'yes'
  • Application_ListView_Default_OrderDirection (What's the difference with 'Application_ListView_Default_Sort_Order'?)
    • Value DESC
    • Default 'yes'
    • Mandatory 'yes'
    • Selected all modules and 'In module list' to 'yes'

Still when I open the Invoices listview, page 1 are the oldest ones, not the newest.


RE: Related lists: can we set a default sort order? - ekullira - 06-16-2022

Hi ! I just saw the problem you had presented. I did some tests and the Global Variables works. I think you should look at the attached link and remake all the steps.
https://www.youtube.com/watch?v=0gkA1g42TSI&t=12s&ab_channel=coreBOS%3A%3AcoreBusinessOperatingSystem