Hi Summet,
Everything seems to be working fine except one thing , The Notes History is Blank, we can't see anything in Notes History, Please help to find out what could be the reason. Thanks!
Please reply.
Below is the code.
CALL METHOD super->get_last_interactions
EXPORTING
iv_bpnumber = iv_bpnumber.
* prepare query parameters
ls_parameter-name = 'BP_NUMBER'. "#EC NOTEXT
ls_parameter-value = iv_bpnumber.
APPEND ls_parameter TO lt_parameter.
* run query / search for last interactions
TRY.
CREATE OBJECT lr_query_service.
CATCH cx_crm_unsupported_object.
me->typed_context->btordercusthist->clear_collection( ).
RETURN.
ENDTRY.
lr_core = cl_crm_bol_core=>get_instance( ).
lr_core->start_up( 'ONEORDER' ).
lr_query = cl_crm_bol_query_service=>get_instance( 'BTQuery1O' ).
lr_query->set_query_parameters( it_parameters = lt_parameter ).
lr_queryres_col = lr_query->get_query_result( ).
CREATE OBJECT lr_result.
lr_entity ?= lr_queryres_col->get_first( ).
WHILE lr_entity IS BOUND.
lr_entity1 ?= lr_entity->get_related_entities( iv_relation_name = 'BTOrderCustHist' ).
lr_result->if_bol_bo_col~add_collection( lr_entity1 ).
lr_entity ?= lr_queryres_col->get_next( ).
ENDWHILE.
IF lr_result IS BOUND.
lr_entity ?= lr_result->if_bol_bo_col~get_first( ).
while lr_entity IS BOUND.
TRY.
lr_entity->get_property_as_value(
EXPORTING iv_attr_name = 'STAT_TXT'
IMPORTING ev_result = lv_object_type ).
IF lv_object_type EQ lv_status.
lr_result->if_bol_bo_col~remove( iv_bo = lr_entity ).
ENDIF.
CATCH cx_bol_exception cx_root.
ENDTRY.
lr_entity ?= lr_result->if_bol_bo_col~get_next( ).
ENDWHILE.
ENDIF.
gr_bol_col = lr_result->if_bol_entity_col~get_copy( ).
me->typed_context->btordercusthist->set_collection( gr_bol_col ).
lr_core->modify( ).