Skip to Content
avatar image
Former Member

sorting the Tasks available in My Open Tasks

Hi Experts

I want to sort the Tasks available in My Open Tasks

Please help me in to sorting according to ID.

Thanks

Shaik Chand

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Jul 10, 2009 at 07:13 PM

    Shaik,

    Enhance the component/view CRMCMP_GS_WC/TodaysTasks

    For the enhhanced view controller redefine the method GET_QUERY_RESULT.

    Call the super of the redefined method. Then for the er_tasks_col object you will need to call the method

    if er_task_col is bound.
    er_tasks_col->sort( iv_attr_name = 'OBECT_ID' ).
    endif.
    

    or

    if er_task_col is bound.
    er_tasks_col->sort (iv_attr_name = 'STRUCT.OBJECT_ID').
    endif.
    

    I believe that should do what you need.

    Take care,

    Stephen

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Yes SreeSanth, you are right. I got the option to redefine the method.

      I am looking into sollution for sorting the Task using the code suggested.

      Thanks

      Chand

  • avatar image
    Former Member
    Aug 03, 2009 at 03:54 AM

    Hi Chand,

    Enhance the component/view CRMCMP_GS_WC/TodaysTasks

    then goto Context related Methods , in this get into Method - DO_INIT_CONTEXT

    and replace the code

    me->typed_context->resultnew->collection_wrapper->sort( iv_attr_name = 'TO'

    iv_sort_order = cl_bsp_wd_collection_wrapper=>sort_ascending

    iv_stable = lv_stable ).

    with the below code

    me->typed_context->resultnew->collection_wrapper->sort( iv_attr_name = 'OBJECT_ID' "'TO' -- Added by Lokesh

    iv_sort_order = cl_bsp_wd_collection_wrapper=>sort_descending "-- Added by Lokesh

    iv_stable = lv_stable ).

    Hope this will solve ur problem.

    Regards,

    Lokesh Banakar.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Yes. Great thanks to Lokesh. The code has worked exactly for my requirement.

      Hi Stephen,

      I have been trying to getsolution through GET_QUERY_RESULT method with suggested code. However I couldnu2019t achieve the output.

      I Hope your code has to solve my requirement in GET_QUERY_RESULT. Can you please get detail code to resolve the issue from your side?

      Thanks

      Chand