locked
How to hide the More Actions "Deactivate" item from main screen RRS feed

  • Question

  • Hi,

    How to hide the More Actions "Deactivate" item from entity level main screen.

     

    Thanks,

    Naveen  

    Wednesday, August 4, 2010 3:28 PM

Answers

  • Hi, Naveen.

     

    This can be done only with unsupported customization.

    Open CRM Website foler, open _root subdirectory. Find HomePage.aspx file and open it with notepad. Find following code:

    <script language="JavaScript">

    function window.onload()
    {
    HandleBackButtonIssues(_currentTypeCode);
    }

    </script>

    and replace it with:

     

    <script language="JavaScript">

    function window.onload()
    {
    HandleBackButtonIssues(_currentTypeCode);

    var currententitycode = '';
    var searchstring = location.search.substring(1);

    var searchstringparts = searchstring.split('&');
    for (var i = 0; i < searchstringparts.length; i++)
    {
        var queryparts = searchstringparts[i].split('=');
        if (queryparts[0] == 'etc')
        {
            currententitycode = queryparts[1];
            break;
        }
    }

    if (currententitycode != '')
    {
        var buttonid = '_MIdoActioncrmGrid' + currententitycode + 'deactivate';
        var deactivatebutton = document.getElementById(buttonid);
        if (deactivatebutton != null)
        {
            deactivatebutton.style.display = 'none';
        }
    }
    }

    </script>


    Microsoft CRM Freelancer

    My blog (english)
    Мой блог (русскоязычный)
    Wednesday, August 4, 2010 4:00 PM
    Moderator
  • Thursday, August 5, 2010 10:19 AM
    Moderator

All replies

  • Hi, Naveen.

     

    This can be done only with unsupported customization.

    Open CRM Website foler, open _root subdirectory. Find HomePage.aspx file and open it with notepad. Find following code:

    <script language="JavaScript">

    function window.onload()
    {
    HandleBackButtonIssues(_currentTypeCode);
    }

    </script>

    and replace it with:

     

    <script language="JavaScript">

    function window.onload()
    {
    HandleBackButtonIssues(_currentTypeCode);

    var currententitycode = '';
    var searchstring = location.search.substring(1);

    var searchstringparts = searchstring.split('&');
    for (var i = 0; i < searchstringparts.length; i++)
    {
        var queryparts = searchstringparts[i].split('=');
        if (queryparts[0] == 'etc')
        {
            currententitycode = queryparts[1];
            break;
        }
    }

    if (currententitycode != '')
    {
        var buttonid = '_MIdoActioncrmGrid' + currententitycode + 'deactivate';
        var deactivatebutton = document.getElementById(buttonid);
        if (deactivatebutton != null)
        {
            deactivatebutton.style.display = 'none';
        }
    }
    }

    </script>


    Microsoft CRM Freelancer

    My blog (english)
    Мой блог (русскоязычный)
    Wednesday, August 4, 2010 4:00 PM
    Moderator
  • Hi Andriy,

    Thanks, It is working fine, Now I want to include the condition to deactivate only for security roles: Case Manager and  Customer Operations Representative.

     

    Thanks

    Naveen

    Thursday, August 5, 2010 10:15 AM
  • Thursday, August 5, 2010 10:19 AM
    Moderator