locked
Hiding the Attach a File icon in CRM 4.0 RRS feed

  • Question

  • Guys,
     
    I am trying to restrict users attaching a file to a entity (Contact).

    So when I create and save a contact, you can then press the 'attach a file' icon on the top menu.  How do I hide this so users can attach a file?

    Is it a sitemap or javascript problem?

    Thanks,

    Anthony
    living is the only thing worth dying for
    Tuesday, February 3, 2009 11:59 AM

Answers

  • Add this code in form load in your contact form ...... I have removed more buttons ... just delete the entries that is not relevant for you.

    //********************************************************************************
    //
    // JSCRIPT FUNCTION FOR REMOVING TOP MENU BUTTONS AND SPACERS
    // Created : 26.08.2008 By: Morten Dybdahl
    //
    //********************************************************************************
    function OnCrmPageLoad()
    {
    // Remove Spacers:
    var imgs = document.getElementsByTagName('IMG');
    var j = 0;
        while(j<imgs.length)
        {
      if(imgs[j].id == 'mnu_hSpacerGrid')
      {
       imgs[j].parentNode.outerHTML = "<SPAN> <SPAN> <SPAN> </SPAN> </SPAN> </SPAN>";
      }
        j=j+1;
        }
    // Company toolbar buttons
    ShowHideToolbarButton( "_MBcrmFormSubmitCrmForm59truetruefalse",3 ); // Save and New
    ShowHideToolbarButton( "_MBcrmFormPrint",3 ); // Print Preview
    ShowHideToolbarButton( "_MBlocAddActTo4202",4 ); // Send E-mail
    ShowHideToolbarButton( "_MBlocAddFileTo5", 4 ); // Add attachment
    ShowHideToolbarButton( "Reports" , 4); //Reports
    ShowHideToolbarButton( "action" , 4); //Action
    ShowHideToolbarButton( "_MBdocumentallRelatedInformationPaneExpanddocumentallRelatedInformationPaneLoadContextDatafollowup" , 4); //Follow Up


    function ShowHideToolbarButton( btnId, span )
    {
     if(document.getElementById(btnId)!=null)
     {
        switch(span)
        {
        case 3:
        document.getElementById(btnId).outerHTML = "<SPAN> <SPAN> <SPAN> </SPAN> </SPAN> </SPAN>";
        break;
        case 4:
        document.getElementById(btnId).outerHTML = "<SPAN> <SPAN> <SPAN> <SPAN> </SPAN> </SPAN> </SPAN> </SPAN>";
        break;
        }
     }
    }

    }
    window.onresize = OnCrmPageLoad;
    OnCrmPageLoad();

    Tuesday, February 3, 2009 1:43 PM