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 the ‘Activities’ 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") { item.setVisible(false); } }); }

The result
