cancel
Showing results for 
Search instead for 
Did you mean: 

Set Default value for the Drop down based on some other drop down value :

Former Member
0 Kudos

Hi Experts,

Can anybody guide me how i can "Set default value in dropdown list based on some other dropdown list value"

CRM WebUI -> Account Management -> Search "Accounts" -> Search Crieteria -> In Last search field (4th Row in Search Criteria)

Here in this drop down List when i am selecting "To Be Archived" , "is" in the middle dropdown , i want to set "not set" as by default option in the last dropdown list.

I have searched the sdn and web, but coud'nt find the solution, then posted this. Please guide me step by step with methods

where i need to code and also the code.

I am new in CRM WebUI.

Thanks in Advance !!!

Thanks,

Chitrakant

Accepted Solutions (1)

Accepted Solutions (1)

arunprakash_karuppanan
Active Contributor
0 Kudos

Hi,

In your search component, Redefine the method get_dquery_definitions, if not already done. Call the super method and get hold of the returned table rt_result. In this table, for the desired field(corresponding to your drop-down field) , specify an event name(SERVER_EVENT). Now, whenever you select a value in the particular drop-down field, an event will be generated. You need not even create an event handler for this. In the same method, (get_dquery_definitions), you can read the currently filled search criteria and depending on the selection modify the order of the operators for the same field.

Regards,

Arun Prakash

Former Member
0 Kudos

Thanks for replying..Let me try this one....

Former Member
0 Kudos

Hi Arun,

As per whet u said, i am getting the internal table from super-> filled but, can u guide me more on SERVER_EVENT.

In the same internal table, i ma getting my DDLB value in 54th row.

Please guide me with some sample code sought off, if you can...

Many Thanks,

Chitrakant

arunprakash_karuppanan
Active Contributor
0 Kudos

Hi,

Suppose I want to rearrange operators if sales group 'O 20000348' is selected in the DDLB option of the sales_group field, I will do the following. The example is based on component BT115QS_SLSQ.




Data: lr_query type ref to CL_CRM_BOL_DQUERY_SERVICE,
         lt_sel_params type GENILT_SELECTION_PARAMETER_TAB,
         ls_operator type crm_thtmlb_search_operator.

field-symbols: <fs_op> type CRMS_THTMLB_SEARCH_FIELD_INFO.

*Specify a dummy server event to trigger on drop down selection event.
    read table rt_result with key field = 'SALES_GROUP' assigning <fs_op>.
    if sy-subrc eq 0.
       <fs_op>-server_event = 'DUMMY_EVENT'
    endif.


*Rearrange operators based on DDLB selection
lr_query ?= me->typed_context->btqslsquot->collection_wrapper->get_current( ).
lt_sel_params = lr_query->GET_SELECTION_PARAM_TABLE( ).

read table lt_sel_params with key attr_name = 'SALES_GROUP' SIGN = 'I' option = 'EQ' low = 'O 20000348' transporting no fields.
if sy-subrc eq 0.
    read table rt_result with key field = 'SALES_GROUP' assigning <fs_op>.
    if sy-subrc eq 0.
*Now, I want the 'NE' operator to come up first.
*delete and insert as first record   
  loop at <fs_op>-operators into ls_operator.
    if ls_operator = 'NE'.
      delete <fs_op>-operators.
    endif.
   endloop.
   if ls_operator = 'NE'.
      insert ls_operator into table <fs_op>-operators index 1.
   endif.
  endif.
endif.

I have not verified the code, but this is the idea.

Regards,

Arun Prakash

Former Member
0 Kudos

Thanks for Helping me...I got some idea through this...but my problem is'nt solved yet...

Rewarding you points !!!

Answers (0)