Actions assignment block in Interaction record.
Hi,
Requirement : Enhancement in which Actions are needed to build in Interaction record in UTIL_IC agent.
Design :
UI Component : GSACTIONS
View : GSACTIONS/Actions
Enhance this view in your enhancement set. redefine the method set_view_group_context and add the code
CREATE OBJECT ME->VIEW_GROUP_CONTEXT TYPE CL_BSP_WD_VIEW_GROUP_CONTEXT.
VIEW_GROUP_CONTEXT->SET_VIEW_EDITABLE( ME ).
ELSE.
ME->VIEW_GROUP_CONTEXT = IV_PARENT_CONTEXT.
ENDIF.
now got to component ICCMP_BT_ACT.
create a component usage for the GSACTIONS/Actions. Please note standard have already exposed the required view in GSACTIONS. once you have created the component usage go to component structure browser and create an overview page. I created an overpage because action AB contains some important fields in it view and all ae required to be visible completely on view. Adding it in ICCMP_BT_ACT/ActViewSet would have added it to the area between notes and notes log which would have not displayed all fields.
So create an overview page. Assign the ICCMP_BT_ACT/ActViewSet and component usage view
Now build one custom controller with model nodes for BTadmiH and ACIActionContext and bind the first one with component controller.
Create the ON_NEW_FOCUS for ACIACTIONCONTEXT and add the code
TRY.
lv_collection = entity->get_related_entities(
iv_relation_name = ‘BTHeaderAction’ ).
CATCH cx_crm_genil_model_error.
* should never happen
EXIT.
CATCH cx_sy_ref_is_initial.
ENDTRY.
me->collection_wrapper->set_collection( lv_collection ).
Now go to your component controller and redefine it and in wd_usage_initialize bind the nodes with usage name with the code
IV_USAGE->BIND_CONTEXT_NODE(
IV_CONTROLLER_TYPE = CL_BSP_WD_CONTROLLER=>CO_TYPE_CUSTOM
IV_TARGET_NODE_NAME = ‘ACIACTIONCONTEXT’ “#EC NOTEXT
IV_NAME = ‘/PES/ICCMP_BT_ACT/CuActionCuco’ “#EC NOTEXT
IV_NODE_2_BIND = ‘ACTIONCONTEXT’ ). “#EC NOTEXT
IV_USAGE->BIND_CONTEXT_NODE(
IV_CONTROLLER_TYPE = CL_BSP_WD_CONTROLLER=>CO_TYPE_CUSTOM
IV_TARGET_NODE_NAME = ‘BTADMINH’ “#EC NOTEXT
IV_NAME = ‘/PES/ICCMP_BT_ACT/CuActionCuco’ “#EC NOTEXT
IV_NODE_2_BIND = ‘PARENTNODE’ ). “#EC NOTEXT
SET HANDLER ME->ACIACTIONCONTEXT->ON_NEW_FOCUS
FOR COLL_WRAPPER ACTIVATION IV_ACTIVATE.
CHECK LR_ENTITY IS BOUND.
OBJECT_ID = LR_ENTITY->GET_PROPERTY_AS_STRING( IV_ATTR_NAME = ‘OBJECT_ID’).
PROCESS_TYPE = LR_ENTITY->GET_PROPERTY_AS_STRING( IV_ATTR_NAME = ‘PROC_TYPE_DESCR’).
CONCATENATE PROCESS_TYPE ‘:’ OBJECT_ID INTO TITLE.
IF OBJECT_ID IS INITIAL.
DESCRIPTION = CL_CRM_UIU_BT_TOOLS=>GET_TITLE_HEADER( LR_ENTITY ).
ELSE.
DESCRIPTION = TITLE.
Thank you.
Regards,
Vishal
Nice doc...