Skip to main content
Error: missing value for parameter 'doc' (index 0) (click for details)
    at xml.text()
    at (Template:0Template:OutSystems/OSCommunityHeader), /content/body/pre[1], line 50, column 29
    at template()
    at (Template:Custom/Views/Header), /content/body/pre[3], line 7, column 13
    at (Documentation/Development_FAQs/How_to_use_the_List_SortColumn_widget_with_an_advanced_SQL_query), /content/body/div[2]/p[8]/a/@fileid

How to use the List_SortColumn widget with an advanced SQL query


How can I use list_sort rich widget with an advanced SQL query?

I see you can use the list_sort widget with an aggregate and the dynamic sort function.


First to implement the support to the list order in the advanced query you need to define the input in the query that you use in the SQL and you also need to pass to the input the output of the List_SortColumn_GetOrderBy passing the Table Records id and the default attribute to order by (using SQL notation):

list_sort sql querry.png

list_sort sql querry2.png

Remember that to test the query you need to pass hard code in the test parameters the value you want.

After this, you need to implement your layout to sort the columns you have on the table records, for that you need to use the webblock List_SortColumn from Richwidgets that converts the header of the table into an header with the ability to sort the contents. Notice that you need to pass the entity and column associated you want to sort by.

list_sort sql querry3.png

I'm also attaching a version of an eSpace with this working.