Quantcast
Channel: SCN : Discussion List - Customer Relationship Management (SAP CRM)
Viewing all articles
Browse latest Browse all 4296

Refresh BTDocFlow

$
0
0

Hi,

 

I have created a button on BTDocFlow assignment block on Lead transaction. The button is used to create NEW ACTIVITY. Everything is working fine. The only problem is when we create new acticity and click SAVE AND BACK on activity. The newly created activity does not show up on lead screen. We need to go out of lead and come back again to see the newly created activity. By going out and coming back to lead - its working fine. But the requirement is to have it refreshed when we come back from acitivity screen. I have written the below code on "New Activity" event handler.

 


 DATA:      lv_guid          TYPE        crmt_genil_object_guid.  DATA: lr_entity1         TYPE REF TO cl_crm_bol_entity.  lr_comp1 ?= me->comp_controller.  lr_entity1 ?= lr_comp1->typed_context->parentnode->collection_wrapper->get_current( ).

* get the GUID of the selected template

  CALL METHOD lr_entity1->get_property_as_value    EXPORTING      iv_attr_name = 'GUID'    IMPORTING      ev_result    = lv_guid.



* get the Order entity

  lr_core = cl_crm_bol_core=>get_instance( ).  lr_entity = lr_core->get_root_entity( iv_object_name = 'BTOrder'                                        iv_object_guid = lv_guid ).  CHECK lr_entity IS BOUND.



* get the AdminH entity

  TRY.      CALL METHOD lr_entity->get_related_entity        EXPORTING          iv_relation_name = 'BTOrderHeader'                "#EC NOTEXT        RECEIVING          rv_result        = lr_entity.    CATCH cx_crm_genil_model_error .  ENDTRY.  CHECK lr_entity IS BOUND.  ls_param-name = 'PROCESS_TYPE'.  ls_param-value = 'ZLD1'.  APPEND ls_param TO lt_param.

**

  ls_param-name  = 'VONA_KIND'.                             "#EC NOTEXT  ls_param-value = 'A'.                                     "#EC NOTEXT  APPEND ls_param TO lt_param.  ls_param-name  = 'RELTYPE'.                               "#EC NOTEXT  ls_param-value = 'VONA'.                                  "#EC NOTEXT  APPEND ls_param TO lt_param.  TRY.

*     Execute createFollowUp-Method in order to create a new one order document for the selected template      lr_result = lr_entity->execute( iv_method_name = 'createFollowUp' "#EC NOTEXT                                      it_param       = lt_param ).      lr_entity->reread( ).    CATCH: cx_crm_genil_model_error cx_crm_bol_meth_exec_failed.      RETURN.  ENDTRY.  CHECK lr_result IS BOUND.



* Get the new BTOrder-Entity

  lr_order ?= lr_result->get_current( ).  CHECK lr_order IS BOUND.



* Call the New Task view via dynamic navigation



  cl_crm_ui_descriptor_obj_srv=>create_ui_object_based(    EXPORTING iv_ui_object_type   = 'BT126_CALL' "'BT126H_CALL'              iv_ui_object_action = 'D'"'D'    RECEIVING rr_result           = lr_nav_descr ).  CHECK lr_nav_descr IS BOUND.  lr_navigation = cl_crm_ui_navigation_service=>get_instance( ).  CHECK lr_navigation IS BOUND.



* Check whether navigation is supported

  IF lr_navigation->is_dynamic_nav_supported( lr_nav_descr ) NE abap_true.    RETURN.  ELSE.



* Navigation

    CREATE OBJECT lr_collection TYPE cl_crm_bol_bo_col.    CHECK lr_collection IS BOUND.    lr_collection->add( lr_order ).    lr_collection->add( lr_nav_descr  ).    lr_navigation->navigate_dynamically( lr_collection ).

 

Any idea whats wrong on the code.

 

Thanks,


Viewing all articles
Browse latest Browse all 4296

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>