locked
How to remove option from action menu (CRM 4.0)

    Question

  •  

    Hi

    How can I remove the 'Get Products' option from the Action menu on the Quote entity?

    Monday, May 5, 2008 6:55 AM

Answers

  • The link shows how to hide buttons and not items on the Action Menu. As you can see items on the Action Menu does not have a title. However it looks like the id for items on the Action Menu are constant.

     


  •  
      
       Get Products...
       

      

     

     

     

    Can be removed using:

     

    Code Snippet

    //Get all of the List Elements
    var lis = document.getElementsByTagName('LI');

    var i = 0;
    //Loop through the list items
    while (i < lis.length) {

    //Don't worry about any list item that doesn't have the title you are looking for.
    if (lis[i].getAttribute('id') == '_MIgetProducts28')
    {

    //Replace the DHTML with blank tags to hide the button
    lis[i].outerHTML='<SPAN></SPAN>'
    }
    i = i + 1;
    }

     

     

     

Monday, May 5, 2008 1:04 PM
  • U can only hide menu using javascript

     

    var lis = document.getElementsByTagName('LI');

     

     

    http://dmcrm.blogspot.com/2008/01/hiding-buttons-in-mscrm-40.html

     

     

    Regards.

    Imran

    Monday, May 5, 2008 8:25 AM
    Moderator
  • All replies

    • U can only hide menu using javascript

       

      var lis = document.getElementsByTagName('LI');

       

       

      http://dmcrm.blogspot.com/2008/01/hiding-buttons-in-mscrm-40.html

       

       

      Regards.

      Imran

      Monday, May 5, 2008 8:25 AM
      Moderator
    • The link shows how to hide buttons and not items on the Action Menu. As you can see items on the Action Menu does not have a title. However it looks like the id for items on the Action Menu are constant.

       


    •  
        
         Get Products...
         

        

       

       

       

      Can be removed using:

       

      Code Snippet

      //Get all of the List Elements
      var lis = document.getElementsByTagName('LI');

      var i = 0;
      //Loop through the list items
      while (i < lis.length) {

      //Don't worry about any list item that doesn't have the title you are looking for.
      if (lis[i].getAttribute('id') == '_MIgetProducts28')
      {

      //Replace the DHTML with blank tags to hide the button
      lis[i].outerHTML='<SPAN></SPAN>'
      }
      i = i + 1;
      }

       

       

       

    Monday, May 5, 2008 1:04 PM
  • There is a developer toolbar for IE available for download at microsoft.com/downloads. This can be
    a uesful tool. It helps in identifying the ID of the Menu Items and Items below Menu Items.

    http://www.microsoft.com/downloads/details.aspx?FamilyID=e59c3964-672d-4511-bb3e-2d5e1db91038&DisplayLang=en

     

     

    Once you install it the IE Developer ToolBar and know the ID of the button you want to hide/unhide, use the javascript syntax as below:

     

    //DEACTIVATE MENU ITEM

    if (document.all._MIgetProducts28 != null) {

    {

    document.all._MIgetProducts28 .style.display = "none";

    }

     

    //ACTIVATE MENU ITEM

    if (document.all._MIgetProducts28 != null)

    {

    document.all._MIgetProducts28.style.display = "";

    }

     

     

     

     

    • Proposed as answer by David Withers Tuesday, May 5, 2009 6:33 PM
    Friday, August 1, 2008 2:18 PM
  • I think we all know that tool

    Can't live without it.

     

    /C

    Sunday, August 3, 2008 10:05 PM
  • Using IE Developer Tool you can find the IDs of Buttons that you want to Hide and then you can put following code on Load Event of Form:
    HideMenuItem_Action("Actions", "_MIgetProducts43"); //Change _MIgetProducts43 with Button ID you want to hide.....
    
    ///////////////////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////////////////////
    ////////////Show/Hide Action /Menu Items///////////////////////////////////
    ///////////////////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////////////////////
    function HideMenuItem_Action(targetMenu, targetMenuItem) {
      var menuLIs = document.getElementById("mnuaction").getElementsByTagName("LI");
      if (menuLIs[targetMenuItem] != null) {
        var item = menuLIs[targetMenuItem];
        item.disabled = true;
    
      }
    
    }
    function ShowMenuItem_Action(targetMenu, targetMenuItem) {
      var menuLIs = document.getElementById("mnuaction").getElementsByTagName("LI");
      if (menuLIs[targetMenuItem] != null) {
        var item = menuLIs[targetMenuItem];
        item.disabled = false;
    
      }
    
    }
    

    Sohaib Ahmad [Business Management Solution Professional] http://www.solutiontalk.blogspot.com
    Thursday, May 5, 2011 7:04 PM
  • Hi, How to add new menu item on Action Menu on Quote record not on Grid(More Actions).
    Natarajan.V
    Thursday, January 12, 2012 1:39 PM