cancel
Showing results for 
Search instead for 
Did you mean: 

Getting the entity frm GUID of an obj frm mthd get_entity of cl_crm_bol_cor

Former Member

Hi Experts,

I am getting a Guid of an object in my function module. Now i need to get the entity with that guid.

I have the object type of the guid.

I am using the method get_entity of cl_crm_bol_core.

TRY.
      lr_core = cl_crm_bol_core=>get_instance( ).

      lr_evhist =  lr_core->get_entity( iv_object_name = 'BT230_SLSC'
                                       iv_object_id   =  lv_genil_object_id ) .

    CATCH cx_crm_unsupported_object .
  ENDTRY.

My problem is that the guid I have, is of type CRMT_OBJECT_GUID. But this method accepts of type crmt_genil_object_guid.

Now how do I convert it.

Please help.

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Instead use simple query object and pass the guid as search parameter to read the entity as below.


* Create a query service
DATA: lv_query TYPE REF TO cl_crm_bol_query_service.
lv_query = cl_crm_bol_query_service=>get_instance(
u2018UIFSearchConnectionu2019 ).
* Set a search criterion
lv_query->set_property( iv_attr_name = u2018CARRIDu2019
iv_value = u2018AAu2019 ).
* Execute query and receive result
DATA: lv_result TYPE REF TO if_bol_entity_col.
lv_result = lv_query->get_query_result( ).

Thanks,

Rajini A.

Former Member
0 Kudos

Thanks Rajni,

This is also looking a right approach.

Let me try it.

Thanks

Answers (0)