Skip to Content

issue with clearing a grayed out search criteria field

Hi,

I have grayed out a field ABC for its default value XYZ in the search criteria of lead search...

But when I click the CLEAR button, it clears the XYZ value of field ABC..

I don't want the value of ABC to be cleared...

Do I need to redefine the CLEAR method?

How do I achieve this purpose?

Thanks

Madhukar

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    Posted on Mar 30, 2015 at 10:32 AM

    Hi Madhukar,

    The Clear button is working as per standard functionality if you want to modify the functionality you have to redefine the method and manipulate according to your requirement.

    ex:

    this is the standard clear button code

    qs ?= me->typed_context->search->collection_wrapper->get_current( ).

    * clear the selection parameter collection....

    CALL METHOD qs->get_selection_params

    RECEIVING

    rv_result = lr_selparam_col.

    lr_iterator = lr_selparam_col->get_iterator( ).

    lr_param = lr_iterator->get_first( ).

    here the parameter values are clearing ( based on parameter low and high value ) in standard search screen so you have to manipulate based on your requirement.

    WHILE lr_param IS BOUND.

    lr_param->get_properties( IMPORTING es_attributes = ls_param ).

    IF ( ls_param-low IS NOT INITIAL ) OR

    ( ls_param-high IS NOT INITIAL ).

    CLEAR: ls_param-low, ls_param-high.

    lr_param->set_properties( EXPORTING is_attributes = ls_param ).

    ENDIF.

    lr_param = lr_iterator->get_next( ).

    ENDWHILE.


    Thanks & Regards,

    Srinivas.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 30, 2015 at 07:46 AM

    Hi Madhu,

    Where did you add the code to set value for XYZ for field ABC. The clear is working as per its functionality. You should change the clear functionality. You can modify the place where you are setting value for the field ABC.

    First option i recommend to add code to set the value in get_dquery_definitions method in your impl class.otherwise you can use do_prepare_output method to set the query parameter with default value.

    Best Regards,

    Dharmakasi.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 30, 2015 at 09:27 AM

    Hi,

    You have to put code in GET_DQUERY_DEFINITION method of the search view IMPL class.

    You have to default the value for your field to ABC there.

    Regards,

    Deepika.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 30, 2015 at 11:25 AM

    I see the name of the person who asked this question as 'rangerlet mesee'. But everyone is replying as 'Hi Madhu/Madhukar'. Is there anything wrong with my eyes?...😉


    Thanks,

    Faisal

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 30, 2015 at 11:52 AM

    Hi,

    I have written the code in do_prepare_output..

    Can I hide the field from the selection criteria, in the do_prepare_output itself? But it should exist among

    the search filters in the background....

    (or)

    Can I have the sample code to make the value of ABC field which is XYZ(default) to not cleared

    even after clicking the clear button?

    What is the code to be written before or after calling the super class of CLEAR..

    As I am new to CRM technical, a clear solution is much appreciated...

    Thanks

    Madhukar

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.