locked
CRM 4 How can I remove the Add Existing buttons? RRS feed

  • Question

  •  

    I am looking for help on how to remove the Add Existing Buttons from my forms on the Grid Toolbar . I have tried to make them hidden via JavaScript as suggested in another post but this is not working. The script is looking for an object that is not there. I used IE Dev Toolbar to make sure I had the correct name for the Add Existing button I wanted to disable or hide.

    Tuesday, August 19, 2008 2:29 PM

Answers

All replies

  • Wednesday, August 20, 2008 6:11 PM
  • Thanks for updating the thread this really helped!!

    Cheers
    Thursday, November 6, 2008 3:54 AM
  • HideAssociatedViewButtons('new_business_new_surveys', ['Add existing Survey to this record', 'Add a new Survey to this record']);
    
    HideAssociatedViewButtons('new_account_new_eventinvite', ['Add existing Event Invite to this record']);  
    
     
    
    function HideAssociatedViewButtons(loadAreaId, buttonTitles){
    
        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'), buttonTitles);
    
            }
    
        }
    
    }
    
     
    
    function HideViewButtons(Iframe, buttonTitles) { 
    
        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 < buttonTitles.length; j++) { 
    
                        for (var i = 0; i < liElements.length; i++) { 
    
                            if (liElements[i].getAttribute('title') == buttonTitles[j]) { 
    
                                liElements[i].style.display = 'none'; 
    
                                break; 
    
                            }
    
                        } 
    
                    } 
    
                } 
    
            } 
    
        }
    
    } 
    Friday, February 12, 2010 11:08 AM