Engineer blog post: Dynamics CRM Online 2015 – Hide Posts, Activities or Notes Of Social Pane social - Axon IT

Written by 1 on 2019-10-09T16:20:45

When creating a custom entity in Microsoft Dynamics CRM Online 2015 you have the option to enable the activities section of the social pane.

Dynamics CRM Online 2015 Tips

Once enabled this cannot be disabled after the entity has been created, but you may only want your users to the see the “Posts” and “Notes” tab. There is no option out of the box to hide any of these tabs, the only option available is to make one of the tabs default.

In this example we will hide the “Activities” section of the social pane using java script.

In the customisations area of CRM we need to add a new web resource, copy the below java script and save it in a notepad file. Save the file with the extension .js

onLoad: function HideActivities() {
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.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;
}
}
}
}
}

Create the web resource and call it whatever you like, browse to and select the .js file you just created.

Dynamics CRM Online 2015 Advice

Next we need to add this web resource to the form you want to hide the tab. Open the form editor and select “Form Properties” from the top toolbar.

On the “Events” tab under Form Libraries click “Add” and find the web resource you just created. In the “Event Handlers” section select “OnLoad” from the drop down list. Click “Add” and select the library you just created, in my example it’s called new_RemoveActivitesTab. In the “function” box you must enter the name you gave the function in the script which in this case is “HideActivites” as you can see on line 1 of the script.

CRM Dynamics Screen Grab

Click OK, save and publish all your changes and the Activities tab will have disappeared from your form.

You might be interested in

Why relationship selling is the secret to selling more

Consumer buying habits have changed a lot in the last decade.

Why relationship selling is the secret to selling more

Consumer buying habits have changed a lot in the last decade.

The 4 questions about GDPR on everyone’s lips

There is less than a year to go until the General Data Protection Regulation becomes law.

6 Office 365 integrations that will boost your productivity and make life easier

There are 27 million Office 365 users across the globe.