zoukankan      html  css  js  c++  java
  • MS CRM 4.0 Rename or Remove Left Nav Bar Menu Items. Written by: Michael Thompson

     In MS CRM 4.0 have you ever wanted to rename or remove Left Nav links on an entity only to find the OnLoad script fails when trying to use the preview function on the form designer? 

    In many CRM installs companies prefer to not use the Microsoft CRM product catalog so that Write-In Products is really the list of products (on a Quote for example) and Existing Products never has anything listed under it.  Thus they would prefer to eliminate the Existing Products link in the left nav area, and rename "Write In Products" to "Products" or possibly "Line Items."

    The scripts below rename the Write-In Products link and remove the Existing Products link.  They also check to see if the link exists before going through the function, thus preserving the preview functionality of the form designer (if you preview a form without running this check, then the preview will throw and error).  This rename also avoids going to the server to pull icons as many other scripts do.  Note in the rename function a line is repeated twice.  No it is not a mistake, it is needed.  The rename function passes in 3 parameters (navName, Display text, name you want displayed).  You will probably need something like IE Dev toolbar to be able to find the navName.

     

    /* Retext/Rename Left Nav Display links. */

    function leftNavRename(leftNav, oldName, newName)

    {

        var navItem = document.getElementById(leftNav);

        if(navItem  != null)

        {

            navItem.innerHTML = navItem.innerHTML.replace(oldName, newName);

            navItem.innerHTML = navItem.innerHTML.replace(oldName, newName);

        }

    }

    leftNavRename ('navWriteInProducts','Write-In Products','Products');

     

     

    /* Remove Left Nav bar links */

    function leftNavRemove(lNav)

    {

        var lNavItem = document.getElementById(lNav);

        if (lNavItem != null)

        {

            lNavItem.parentNode.style.display ='none';

        }

    }

    leftNavRemove('navExistingProducts');


    Re: MS CRM 4.0 Rename or Remove Left Nav Bar Menu Items.

    Yes you can, most NAV items can have displayed text changed using the function. You must know the ID of the part you wish to change (the reason for the IE Dev Toolbar reference above). Here is how the onload function would look.

    function leftNavRename(leftNav, oldName, newName)
    {
    var navItem = document.getElementById(leftNav);
    if(navItem != null)
    {
    navItem.innerHTML = navItem.innerHTML.replace(oldName, newName);
    navItem.innerHTML = navItem.innerHTML.replace(oldName, newName);
    }
    }
    leftNavRename ('_MIcomplete','Close Opportunity...', 'Complete Opportunity');
  • 相关阅读:
    人员考勤,MySQL数据库一个表自动生成3表筛选人员迟到早退缺勤
    Thinkphp中js报错,Uncaught SyntaxError: Unexpected token }
    Invalid ON UPDATE clause for 'create_date' column
    mysql创建某个数据库中的某张表 只读用户
    iOS开发 iOS9横屏后状态栏隐藏处理
    iOS开发 个别页面是否支持页面旋转
    iOS开发 点击某处横屏竖屏切换
    iOS开发 QQ粘性动画效果
    iOS开发 贝塞尔曲线
    iOS开发 获取状态栏的点击事件
  • 原文地址:https://www.cnblogs.com/janmson/p/1510294.html
Copyright © 2011-2022 走看看