Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 79901

get this error when hiding activities tab in social pane

$
0
0

i, I am trying to hide activities tab in social pane in dynamics 365. Below is the JS code, but  I keep getting the code when form loads. I believe the event handler is correctly set. Please advise 

function HideSocialPaneItems() {
    var tabs = ["ACTIVITIES"];
    for (var tabsid = 0; tabsid < tabs.length; tabsid++) {
        HideTabs(tabs[tabsid]);
    }
}

function HideTabs(socialPaneType) {
    var ctrlElement = document.getElementById("header_notescontrol");
    if (ctrlElement.children != null && ctrlElement.children.length > 0) {
        for (var ele = 0; ele < ctrlElement.children.length; ele++) {
            var ctrl = ctrlElement.children[ele];
            if (ctrl.title == socialPaneType) {
                ctrl.style.display = "none";
                if (ele + 1 < ctrlElement.children.length) { ctrlElement.children[ele + 1].click(); return; } else if (ele - 1 >= 0) {
                    ctrlElement.children[ele - 1].click();
                    return;
                }
            }
        }
    }
}

Viewing all articles
Browse latest Browse all 79901

Trending Articles