cancel
Showing results for 
Search instead for 
Did you mean: 

Delete attachment linked to activity in ICWEB

Former Member
0 Kudos

Hello

I have implemented the deltion of attachment using following code. the commands went sucessfull but it is not deleting attachment(which is linked to activity/interaction record)

lr_entity_col = lv_bo->get_related_entities( iv_relation_name = cl_crm_cm_genil_comp=>gc_rel_bo_document_ref ).

lv_bo = lr_entity_col->get_first( ).

lv_bo->delete( ).

lv_core->modify( ).

lv_transaction = lv_core->get_transaction( ).

lv_transaction->save( ).

lv_transaction->commit( ).

Does anybody implemented similar logic?

Regards,

Laxman

Accepted Solutions (0)

Answers (1)

Answers (1)

raja_thangamani
Active Contributor
0 Kudos

Where are the attachments stored?

Raja T

Former Member
0 Kudos

I have added custom tab to store attach the files to Interaction recrod i.e business activity.

I m using following way to add attachment

  • create document child

lv_core = cl_crm_bol_core=>get_instance( ).

lv_transaction = lv_core->begin_transaction( ).

IF lv_bo->lock( ) = if_genil_boolean=>true.

if lv_bo->is_changeable( ) = abap_true.

TRY.

lv_doc = lv_bo->create_related_entity(

cl_crm_cm_genil_comp=>gc_rel_bo_document_ref ).

CATCH cx_crm_genil_model_error.

CATCH cx_crm_genil_duplicate_rel.

ENDTRY.

endif.

regards,

Laxman