Skip to Content
0
Former Member
Nov 27, 2012 at 05:59 AM

CRM WEB UI : Collection Sorting issue/Assignment block sorting issue.

392 Views

Hi Experts,

Can you please help me to resolve the below issue:

We have two assignments blocks which are available on the Accounts Over view page. We want to sort records of first assignment block on some field zfield1 which is a zfield, and the same is with another assignment block also, where the records are to be sorted on another zfield ZFIELD2. Each assignment is assigned to a different UI Configuration.

I have written code in DO_PREPARE_OUTPUT method of the view, where I have sorted the collections using :

CALL METHOD COLL_WRAPPER->IF_BOL_BO_COL~SORT
EXPORTING
IV_ATTR_NAME = 'ZFIELD1'
IV_SORT_ORDER = cl_bsp_wd_collection_wrapper=>sort_descending.

The same is repeated for another assignment block also, which is assigned to a different UI Configuration with zfield ZFIELD2.

The sorting is working fine for the second assignment block. But in case of the first assignment block, on load of the page the sorting is not happening,

but when we click on the back button available on the over view page and once again come back to the over view page by selecting the account (which was a result of a search) now the sorting is working fine for the first assignment block also. and in any case there is no problem with sorting of the second assignment block.

I am not getting where it went wrong, Please correct whether DO_PREPARE_OUTPUT is the correct place to do the sorting or is there any other method where we can sort the collection or any other technique available to achieve the same.

Thanks in Advance!!

Regards

Srinivasa Reddy