How to hide ‘Activities’ and ‘Closed Activities’ from custom entity forms in Dynamics CRM 2011

A common requirement for some Dynamics CRM implementations is to hide navigation items in the left navigation pane on any entity form.

Here’s the problem, you won’t have any issues doing that for system entities, the system allows you to remove ‘Activities’ and ‘Closed Activities’ using the forms’ customisation window.


However, you will notice on custom entities, that you don’t actually get the option to remove activities at all.


The fix

Load the following JavaScript snippet code to programmatically set the visibility to false for theActivities’ and ‘Closed Activities’ buttons.

function HideNavigationActivities() {
    Xrm.Page.ui.navigation.items.forEach(function (item, index) {
        var itemLabel = item.getLabel();
        if (itemLabel == "Activities" || itemLabel == "Closed Activities") {

The result