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

Help with Custom Script

$
0
0

Hello All

I am wondering if somebody can help me to edit some Custom Script I am using.

The below Script is added to our Solution and it is working correctly,  however when the Social Pane loads on any form is defaults to show the "Notes" Tab input,  even though the notes header text is being hidden by the script.  If a user does not click off of this they can successfully add a note but of course once they click off of it they are not able to return to it.

Here is an example screenshot of what I mean:

1 = On Load

2 = On Select

I would like to add to this script so that is defaults to load the POSTS Tab and Input by default.

Here is the code:

function HideSocialPaneItems() {
    var tabs = ["ACTIVITIES", "NOTES"];
    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;
                }
            }
        }
    }
}


Additionally,  I am ensured the correct Tab is selected to load by default on the Social Pane Properties.

Hope somebody can help and appreciate any support!

Regards,

Tim


Viewing all articles
Browse latest Browse all 46379

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>