Sort Entire List not just the MaxRecords
Question
Application Type
Reactive
Service Studio Version
11.11.12 (Build 47321)

Hi Team,

I have used a structure as a list and the same list is appended when the page is loaded with the aggregate input.


The same structure list has been used for Table input with having Maxrecords to 8. I will be able to see only 8 records on the page with page navigation which is correct.


Issue:- If we use sorting in the table, it just sorts the records within the 8 records, but it has to sort the entire list.

Can this be done without refreshing the aggregate again. Attached is the OML file for your reference.

Example:

Below Emp Name columns has A to Z records when I sort by Emp Name it just sort A to H.

Before Sort:

After Sort:


Regards,

Vinod


Emp.oml

Solution

Hi Vinod,

Please go through the approach followed in OML, for your problem's reference. Hope this helps.

URL : https://saravanan-gamechanger.outsystemscloud.com/Emp/EmpDBS?_ts=637642798243671385

Regards,

Saravanan Santhanam.

Emp.oml

Thanks, Saravanan


It worked


Regards,

Vinod

Hi Vinod,

When you change the sort order, you'll have to go to the place where all data are and apply the sort.  This means in your case re-execute the aggregate with the changed sort order.

You are retrieving only 8 records from the database and bringing them back to your client.  For some reason you copy the aggregate result, fine, but you still only have 8 records available in your client.  

Then in the OnSort, you decide to apply some complex logic with several ListSort.  You are only applying this to the 8 available records, the others are still just in the database, not available to your ListSort.  

Dorine


mvp_badge
MVP

Hey Vinod,

In addition of Dorine's answer...

Yesterday I answered a very similar problem.

Check it here

It can help you to understand the default platform sort and pagination if you are having trouble.

If the reason you are doing that is because you want to avoid refresh the aggregate, you cant use the max records you would need to retrieve everything at once and order it on your client side.


Keep in mind that doing that is not a best practice.
You should keep using pagination and sorting the table at database level.

If you want to change your sorting rule depending on the field you selected you can still use the default behavior of the platform and only change the TableSort var.

Hope it helps,

RR :)


Hi,

Please find the below for your reference,

https://www.outsystems.com/forums/discussion/72490/sorting-a-entire-table-using-a-list/

Kind Regards,

Ajit kurane.

Solution

Hi Vinod,

Please go through the approach followed in OML, for your problem's reference. Hope this helps.

URL : https://saravanan-gamechanger.outsystemscloud.com/Emp/EmpDBS?_ts=637642798243671385

Regards,

Saravanan Santhanam.

Emp.oml

Thanks, Saravanan


It worked


Regards,

Vinod

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.