MSCRM4 隐藏按钮方法

作者: 傻猫    分类: 搞软件     发布时间: 12-24 18:02    浏览次数: 5662     无留言

///////////////////////////////////隐藏  将现有客户收费单添加到此记录 按钮//////////////////////////////////////////newnewkhjbxxnewkhsfd
//客户收费单
HideAssociatedViewButtons('new_new_khjbxx_new_khsfd',  ['_MBtoplocAssocOneToMany10040newnewkhjbxxnewkhsfd']); 
//客户证件信息
HideAssociatedViewButtons('new_new_khjbxx_new_khzjxx', ['_MBtoplocAssocOneToMany10074newnewkhjbxxnewkhzjxx']);
//客户帐号信息
HideAssociatedViewButtons('new_new_khjbxx_new_khzhxx', ['_MBtoplocAssocOneToMany10043newnewkhjbxxnewkhzhxx']);

//延期客户信息
HideAssociatedViewButtons('new_new_khjbxx_new_yqkhxx', ['_MBtoplocAssocOneToMany10060newnewkhjbxxnewyqkhxx','_MBcrmGridPrint','_MBcrmGridExportToExcel','_MBWebMailMergecrmGrid10060'
,'_MBdoActioncrmGrid10060assign','_MBdoActioncrmGrid10060delete','MoreActions']);


//-----------------------------------隐藏帧里的按钮----------------------
//-----------------------------------by 王大勇 2010-12-24----------------
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function HideAssociatedViewButtons(loadAreaId, HideEleIDs) {
    var navElement = document.getElementById('nav_' + loadAreaId);
    if (navElement != null) {
        navElement.onclick = function LoadAreaOverride() {
            // Call the original CRM method to launch the navigation link and create area iFrame
            loadArea(loadAreaId);
            HideViewButtons(document.getElementById(loadAreaId + 'Frame'), HideEleIDs);
        }
    }
}

function HideViewButtons(Iframe, HideEleIDs) {
    if (Iframe != null) {
        Iframe.onreadystatechange = function HideTitledButtons() {
            if (Iframe.readyState == 'complete') {
                var iFrame = frames[window.event.srcElement.id]; //var liElements = iFrame.document.getElementsByTagName('li');     
    
    for (var j = 0; j < HideEleIDs.length; j++) {
                  iFrame.document.getElementById(HideEleIDs[j]).style.display = 'none';
                }
    
            }
        }
    }
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Tags: mscrm, 按钮

添加新评论