SortRecordList is not working

SortRecordList is not working

  

Hi,

I am trying to use SortRecordList for sorting a column in my module but It's not working. I am not getting why it is not working, What did I wrong. Can anyone help in this situation? PFA module.


Hi Trinusha,

But what happened? did nothing? Did you have any error?



Diogo Coelho wrote:

Hi Trinusha,

But what happened? did nothing? Did you have any error?




Hi Diogo,

I didn't get any error but when I am clicking on the Order by status button in the bookings table it is not sorting. I am not getting where I did the mistake. Can you please let me know where I did the mistake.

Regards,

Trinusha.


Hi Trinusha,

I tested you solution in my environment and is working. But I did remove the DragTable\DragTableJS. I dont have this installed in my environment and maybe it could be that this is what is causing you problems.

Regards,

Marcelo

Marcelo Ferreira wrote:

Hi Trinusha,

I tested you solution in my environment and is working. But I did remove the DragTable\DragTableJS. I dont have this installed in my environment and maybe it could be that this is what is causing you problems.

Regards,

Marcelo

Hi Marcelo,

I tried removing dragtable but it still not working.

Regards,

Trinusha.



Hi Trinusha,

As you can check in this screen https://marceloserranoferreira.outsystemscloud.com/Bookings_Trinusha/Bookings.aspx. if you click on room name it is working.

Regards,

Marcelo

Hi Trinusha,

Just add only one Dynamic Sort expression:

List_SortColumn_GetOrderBy(BookingTable.Id,DefaultOrder:)

It worked in my case (for all table records column).



Hope it helps.


Kind Regards,

Benjith Sam

Hi Trinusha,


You are using SortListRecord on BookingList that is not initialized.

So SortListRecord are always sort an empty List.


Also  BookintTable are bind with GetRoomsWithBookings, 

So even SortListRecord worked, You'll never see the sort result displayed.



Hi Trinusha,

After Wei I understood your really problem. As he said you need to sort the correct list. in this case I don't recommend you to use SortRecordList. You should use RichWidgets\List_SortColumn like you did for Room. This is the correct way of doing this specially for someone that is new to Outsystems.

Regards,

Marcelo


Hi Trinusha,

As Marcelo mentioned my above comment is also based on RichWidgets\List_SortColumn use. I didn't used the SortRecordList action in my personal implementation to sort the column.


Thanks,

Benjith Sam

Marcelo Ferreira wrote:

Hi Trinusha,

After Wei I understood your really problem. As he said you need to sort the correct list. in this case I don't recommend you to use SortRecordList. You should use RichWidgets\List_SortColumn like you did for Room. This is the correct way of doing this specially for someone that is new to Outsystems.

Regards,

Marcelo



Hi Marcelo,

I tried using List_Sort Column and it is working. I am trying with sort record list because, I want to sort multiple columns as below module

regards,

Trinusha.

Wei Zhu wrote:

Hi Trinusha,


You are using SortListRecord on BookingList that is not initialized.

So SortListRecord are always sort an empty List.


Also  BookintTable are bind with GetRoomsWithBookings, 

So even SortListRecord worked, You'll never see the sort result displayed.




Hi,

How should I resolve these errors?

How should I initialize the sortRecordList?

To display data Booking Table should link with GetRoomswithBooking, How should I avoid that?


Hi Trinusha,

What you are trying to accomplish will not work in a list with pagination. because some Outsytems particularities. My recommendation is use RichWidgets\List_SortColumn like you did it for room and only sort by 1 column.

But if you really want to do it like that you need to remove the pagination, change bookingList to also include room on the list, in the preparation assign BookingList with the result of the aggregate and on the screen >      BookingTable use bookinglist as source record list.

Regards,

Marcelo



Marcelo Ferreira wrote:

Hi Trinusha,

What you are trying to accomplish will not work in a list with pagination. because some Outsytems particularities. My recommendation is use RichWidgets\List_SortColumn like you did it for room and only sort by 1 column.

But if you really want to do it like that you need to remove the pagination, change bookingList to also include room on the list, in the preparation assign BookingList with the result of the aggregate and on the screen >      BookingTable use bookinglist as source record list.

Regards,

Marcelo




Hi Marcelo,

I did the changes what you mentioned but I am getting the following error when I am clicking on the order by status.


Regards,

Trinusha.

Hi Trinusha,

I have implemented the Booking Exercise in my personal environment and also have implemented sorting in multiple columns in Booking List Screen. Please find the attachment.

Screen: Booking List Screen


Hope it helps.

Kind Regards,

Benjith Sam

Benjith Sam wrote:

Hi Trinusha,

I have implemented the Booking Exercise in my personal environment and also have implemented sorting in multiple columns in Booking List Screen. Please find the attachment.

Screen: Booking List Screen


Hope it helps.

Kind Regards,

Benjith Sam

Hi Benjith,

Thank you but I am looking for Sorting of multiple columns as below.

             Check in                              Status

             Nov 2                                     booked

                                                          check in

                                                          Check Out

              Nov 6                                 cancelled

                                                        checkout

If I first select first check in and then If I select Status. It should display like this. We should increment first checin and then based on that it should increment status.

Regards,

Trinusha.


Solution

Hi Trinusha,

For SortRecordList you need to use "Booking.GuestLastName"

Regards,

Marcelo

Solution

Marcelo Ferreira wrote:

Hi Trinusha,

For SortRecordList you need to use "Booking.GuestLastName"

Regards,

Marcelo

Hi Marcelo,

Thank you, Its Working.

Regards,

Trinusha.