Quantcast
Channel: SCN: Message List - SAP CRM: Webclient UI - Framework
Viewing all articles
Browse latest Browse all 7775

Re: Restricting Navigation in IC-Agent

$
0
0

Hi Pathak,

 

This can be done with some enhancements to the view 'CRMCMP_NAVBAR/MainNavigationLinks' of component 'CRMCMP_NAVBAR'.

Just enhance the component and then the view .

Now put the below code in the 'MainNavigationLinks.htm' page of the enhanced view.

 

<%@page language="abap" %>

<%@extension name="htmlb" prefix="htmlb" %>

<%@extension name="xhtmlb" prefix="xhtmlb" %>

<%@extension name="crm_bsp_ic" prefix="crmic" %>

<%@extension name="bsp" prefix="bsp" %>

<%@extension name="thtmlb" prefix="thtmlb" %>

<%

   data: lv_new type string.

   lv_new = 'X'.

   Datalr_gdc TYPE REF TO if_crm_ui_data_context,

        lr_bo_prop TYPE REF TO cl_crm_bol_entity,

        lr_menu    TYPE CRMT_THTMLB_MENU_ITEM,

        ls_menu    LIKE LINE OF lr_menu.

 

     lr_gdc = cl_crm_ui_data_context_srv=>get_instance( ).

     CHECK lr_gdc IS BOUND.

     lr_bo_prop ?= lr_gdc->get_entity( name = 'CURRENTCUSTOMER' ).

     if lr_bo_prop is INITIAL.

 

     lr_menu[] controller->menu_items[].

     refresh: controller->menu_items.

     delete lr_menu where ID eq 'IC_BT_INR'.

     controller->menu_items[] = lr_menu[].

     else.

       lr_menu[] controller->menu_items[].

       refresh: controller->menu_items.

       read TABLE lr_menu INTO ls_menu with key link_id = 'IC_BT_INR'.

       if sy-subrc ne 0.

          ls_menu-item_level = '0000'.

          ls_menu-ID         = 'IC_BT_INR'.

          ls_menu-text      = 'Interaction Record'.

          ls_menu-link_id   = 'IC_BT_INR'.

          ls_menu-tooltip   = 'Interaction Record'.

 

          APPEND ls_menu TO lr_menu.

          controller->menu_items[] = lr_menu[].

       ELSE.

          controller->menu_items[] = lr_menu[].

       endif .

     ENDIF.

 

   if lv_new is initial.

%>

<thtmlb:menu menuItems="<%= controller->menu_items %>" />

<%

   else.

%>

<thtmlb:menuII id        = "mainmenu"

                menuItems = "<%= controller->menu_items %>" />

<%

   endif.

%>



Here I am hiding the Interaction Record workcenter if the account is not confirmed. You can do it for service request. you can find the Details like item level ,ID text etc. for service request from the table 'controller->menu_items' using debugger.


Thanks

Kumar


Viewing all articles
Browse latest Browse all 7775

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>