“Social Pane” a new feature introduced in Microsoft Dynamics CRM 2013. We can see POSTS, ACTIVITIES and NOTES tab in Social Pane.
We can hide them as per the business need. Will show you with a simple example to hide ACTIVITIES tab from Social Pane.
Example: Hide NOTES tab from Social Pane in Contact Entity
Solution: Include the below Script in a JavaScript Webresource and call the function “HideSocialPaneItems” in Contact Onload and include the input parameter as “ACTIVITIES” to hide ACTIVITIES tab.
//Description : To hide POSTS or ACTIVITIES or NOTES in Social Pane
//Input : “POSTS” or “ACTIVITIES” or “NOTES”
function HideSocialPaneItems(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; } } } } }
Output:
Nice Blog, thanks for sharing this kind of information.
LikeLike
Hi!
This helped a lot, but now we have a case where we’d like to hide the Posts AND the Activity Pane. We’ve managed to hide them, but the Activity Pane menu remains as default setting. Any idea how to have Notes only? Notes only like on the old imported forms?
On the Contract Lines form there are only Notes, but we can’t figure out why, and we’d like to have it on the other main forms. We’d rather use an Activity subgrid instead of the Activity Pane…
Thanks a lot!
LikeLike
Hi Anna,
Please check the below article,
https://arunpotti.wordpress.com/2015/09/04/set-posts-or-activities-or-notes-as-default-tab-under-social-panes-in-microsoft-dynamics-crm/
Hope it helps.
LikeLike
Thanks for the response, but unfortunately our goal is to make the Activity and Posts tabs completely invisible, not just make Notes the default tab. Just like on Contract Lines or Email, there are no other tabs apart from Notes.
We did what you described in the post above – and the Posts tab is hidden, Notes default tab – great! But the interesting point is how to hide the Activitiy Tab as well.
LikeLike
Hi Anna,
If i understand your requirement completely, you should have only Notes.
Activities and Posts should hide onLoad of record.
If this the requirement, please use the below function by removing parameters,
function HideSocialPaneItems() {
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 == "ACTIVITIES" || ctrl.title == "POSTS") {
ctrl.style.display = "none";
} else if (ctrl.title == "NOTES") {
if (ele + 1 = 0) {
ctrlElement.children[ele – 1].click();
return;
}
}
}
}
}
LikeLike
Hi Anna,
If i understand your requirement completely, you should have only Notes. Activities and Posts should hide onLoad of record.
If this the requirement, please use the below function alone without specifying parameters as mentioned in my post,
function HideSocialPaneItems() {
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 == "ACTIVITIES" || ctrl.title == "POSTS") {
ctrl.style.display = "none";
} else if (ctrl.title == "NOTES") {
if (ele + 1 < ctrlElement.children.length) {
ctrlElement.children[ele + 1].click();
return;
}
}
}
}
}
LikeLike
This is not working I am getting error in CRM 2016 while using the above script.
Getting error on below line
var ctrlElement = document.getElementById(“header_notescontrol”);
Error Message
TypeError: Unable to get property ‘children’ of undefined or null reference
at HideSocialPaneItems (https://dev.crm.dynamics.com/%7B635933707610000079%7D/WebResources/aac_HideTabSocialPane?ver=1256498646:4:5)
at eval code (eval code:1:1)
at RunHandlerInternal (https://dev.crm.dynamics.com/form/ClientApiWrapper.aspx?ver=1256498646:156:1)
at RunHandlers (https://dev.crm.dynamics.com/form/ClientApiWrapper.aspx?ver=1256498646:115:1)
at Anonymous function (https:dev.crm.dynamics.com/form/ClientApiWrapper.aspx?ver=1256498646:99:63)
at Anonymous function (https://dev.crm.dynamics.com/_static/_common/scripts/MicrosoftAjax.js?ver=1256498646:1:294)
LikeLike
Hi Rajeev,
Unfortunately, it will not work in 2016. Only it will work in CRM 2013.
LikeLike
Hi Arun,
Thanks for this – managed to get it working in 2016.. Needs a parent. infront of the document.getElementById() to make it work but thanks for the code as everything else worked fine.
LikeLiked by 1 person
Greate pieces. Keep posting such kind of information on your blog.
Im really impressed by your blog.
Hey there, You have performed an excellent job. I’ll
certainly digg it and personally recommend to my friends.
I am sure they’ll be benefited from this web site.
LikeLike
Thank you 🙂
LikeLike
I do not even undrstand how I finished up here,
but I thought this post used tto be good. I don’t recognise who you’re but definitely you are going to
a well-known blogger iif you are not already. Cheers!
LikeLike
Thank you 🙂
LikeLike
Hi Arun,
Can we hide “Add Phone call” option under activities in Social pane.
LikeLike
No Narmada, we can’t hide “Add Phone call”.
LikeLike
I juszt like the valuable information you supply on your articles.
I’ll bookmark your blog and take a llook at nce more right here regularly.
I’m slightly sure I will be told many new stuff proper rright here!
Good luck for tthe following!
LikeLike
Thank you a bunch for sharing this with all folks you really realize what you’re talking approximately!
Bookmarked. Please also talk over with my site =). We could have a hyperlink
alternate arrangement among us
LikeLike
Thank you 🙂
LikeLike