Generate a link to open a document in the WebUI

Problem: you want to open a document in the WebUI by clicking on a link in an email.

Solution: what you need is a link to the document. To get one, first you will need an address of the current server.

DATA:
  lv_full_url TYPE string,
  lv_server_url TYPE string,
  lo_appl_model TYPE REF TO if_bsp_wd_appl_model.
 
lo_appl_model = cl_bsp_wd_appl_model=>get_appl_model( 
  iv_bsp_appl = 'CRM_UI_START' 
  iv_model_type = 'CL_BSP_WD_APPL_MODEL_RTTI' ).
lv_server_url = lo_appl_model->get_start_url( ).
DATA:
  lv_full_url TYPE string,
  lv_server_url TYPE string,
  lo_appl_model TYPE REF TO if_bsp_wd_appl_model.

lo_appl_model = cl_bsp_wd_appl_model=>get_appl_model( 
  iv_bsp_appl = 'CRM_UI_START' 
  iv_model_type = 'CL_BSP_WD_APPL_MODEL_RTTI' ).
lv_server_url = lo_appl_model->get_start_url( ).

Now, you need to add variables pointing to a specific document.

lv_full_url = lv_server_url.
CONCATENATE lv_full_url '&crm-object-keyname=GUID' INTO lv_full_url.
CONCATENATE lv_full_url '&crm-object-type=BT116_SRVO' INTO lv_full_url.
CONCATENATE lv_full_url '&crm-object-action=B' INTO lv_full_url.
CONCATENATE lv_full_url '&crm-object-value=' ls_result-guid INTO lv_full_url.
lv_full_url = lv_server_url.
CONCATENATE lv_full_url '&crm-object-keyname=GUID' INTO lv_full_url.
CONCATENATE lv_full_url '&crm-object-type=BT116_SRVO' INTO lv_full_url.
CONCATENATE lv_full_url '&crm-object-action=B' INTO lv_full_url.
CONCATENATE lv_full_url '&crm-object-value=' ls_result-guid INTO lv_full_url.
  • CRM-OBJECT-KEYNAME – contains a value of a field which is used to find the document, e.g.: GUID, OBJECT_ID, PARTNER_GUID.
  • CRM-OBJECT-TYPE – contains the type of the object that you want to show in WebUI; you can get the names of the objects from TCODE BSP_DLC_SDESIGN.
  • CRM-OBJECT-ACTION – action which should be performed on the document, e.g.: B – Display, C – Change. More actions available in the Navigation Bar Profiles configuration
  • CRM-OBJECT-VALUE – value for the CRM-OBJECT-KEYNAME variable.

Komentowanie jest zakończone.