cancel
Showing results for 
Search instead for 
Did you mean: 

Lead Duplication and Custom Pop Up

Former Member
0 Kudos
89

Dear Experts,

I have to validate the Lead while creation for duplication on certain criteria like sales area, prospect, process type and Object Type,if any duplicate record found while saving needs to pop up the with custom message and that to i have to make OK and Cancel buttons in that POP UP. OK is to create duplicate record and cancel for not to create duplicate.

for this requirement can any body provide solution for this .

when we checked at run time the standard charecterstics used are as follows which will met our custom requirement but we couldn't understand the Date_1 and Date_2 fields.

CRMT_REPORT_DYN_SQL_LINE>CRMD_ORDER_INDEX~OBJECT_TYPE IN ('BUS2000108', 'BUS2000129') AND</CRMT_REPORT_DYN_SQL_LINE> 

<CRMT_REPORT_DYN_SQL_LINE>CRMD_ORDER_INDEX~TEMPLATE_TYPE_IX = '' AND</CRMT_REPORT_DYN_SQL_LINE>

<CRMT_REPORT_DYN_SQL_LINE>CRMD_ORDER_INDEX~PROCESS_TYPE_IX = 'XXX' AND</CRMT_REPORT_DYN_SQL_LINE>

<CRMT_REPORT_DYN_SQL_LINE>CRMD_ORDER_INDEX~SALES_ORG = 'XXXXXX' AND</CRMT_REPORT_DYN_SQL_LINE>

<CRMT_REPORT_DYN_SQL_LINE>CRMD_ORDER_INDEX~DIS_CHANNEL = 'XX' AND</CRMT_REPORT_DYN_SQL_LINE>

<CRMT_REPORT_DYN_SQL_LINE>CRMD_ORDER_INDEX~DIVISION IN ('XX', '') AND</CRMT_REPORT_DYN_SQL_LINE>

<CRMT_REPORT_DYN_SQL_LINE>crmd_order_index~pft_6 = 'X' AND</CRMT_REPORT_DYN_SQL_LINE>

<CRMT_REPORT_DYN_SQL_LINE>CRMD_ORDER_INDEX~PARTNER_NO = 'XXXXX' AND</CRMT_REPORT_DYN_SQL_LINE>

<CRMT_REPORT_DYN_SQL_LINE>CRMD_ORDER_INDEX~STAT_OPEN = 'X' AND</CRMT_REPORT_DYN_SQL_LINE>

<CRMT_REPORT_DYN_SQL_LINE>CRMD_ORDER_INDEX~DATE_1 GE 'XXXXXXXXx ' AND</CRMT_REPORT_DYN_SQL_LINE>

<CRMT_REPORT_DYN_SQL_LINE>CRMD_ORDER_INDEX~DATE_2 LE 'XXXXXXx ' AND</CRMT_REPORT_DYN_SQL_LINE>

<CRMT_REPORT_DYN_SQL_LINE>CRMD_ORDER_INDEX_SECOND~PARTNER_NO = 'XXXXXX' AND</CRMT_REPORT_DYN_SQL_LINE>

<CRMT_REPORT_DYN_SQL_LINE>crmd_order_index_second~pft_7 = 'X'</CRMT_REPORT_DYN_SQL_LINE>
ccan somebody explain the same and suggest the approach to ahcieve our custom pop up message with two buttons Confirm and Cancel.

it it would be great if somebody respond to this at the earliest.

Best Regards,

Venat

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member193352
Active Contributor
0 Kudos

Hi Venky,

  • Declare GR_POPUP attribute in the view implementation class
  • Redefine the EH_ONSAVE method, validate the duplicate record and implement the following sample code before save and exit the method without saving.

CALL METHOD comp_controller->window_manager->create_popup_2_confirm

       EXPORTING

         iv_title          = 'Error Message'

         iv_text           = 'text-001'              " Duplicate Record Found. Create Duplicate?

         iv_btncombination = if_bsp_wd_window_manager=>co_btncomb_okcancel

       RECEIVING

         rv_result         = gr_popup.

     gr_popup->set_on_close_event( iv_event_name = 'CLOSE'     iv_view = me ).

     gr_popup->set_display_mode( if_bsp_wd_popup=>c_display_mode_surrounded ).

     gr_popup->open( ).

Now create another event handler method through the wizard using the event name CLOSE (created above in line 11). Implement the following sample code in EH_ONCLOSE method:

data: lv_answer type string.

   lv_answer = gr_popup->get_fired_outbound_plug( ).

    if lv_answer = 'OK'.

***** Create Duplicate Records ****        

elseif lv_answer = 'CANCEL'                    .

***** Don't Create Duplicate Records ****

endif.

Hope this helps.

Thanks

Vishal

Former Member
0 Kudos

Thanks Vishal,

we are success for checking duplication while creation, but couldn't for you know, if we are click on edit Prime Lead and click on save(with out any modification) its getting triggered custom pop up which shouldn't.

could you please suggest me on this how to proceed if we are in modification page.

Best Regards,

Venky

Former Member
0 Kudos

please do put a check before calling the popu like below statement

lr_entity->chech_save_needed( ).

if it returns false then dont call popup

former_member193352
Active Contributor
0 Kudos

Dear Venky,

Please make sure you are writing the custom pop up code in EH_ONSAVE method like this:

****** Custom Code to check Duplicate Lead ******

** If condition is true **

RETURN.

else.

CALL METHOD super->eh_onsave( ).

endif.

Hope this helps.

Thanks

Vishal