Friday, 31 October 2014

Hiding ‘Activities’ and ‘Closed Activities’ from Custom Entity forms in Dynamic CRM 2013



One of the most common and general requirement in dynamic CRM implementations is hiding Activities and Closed Activities in Custom Entities.

For System Entities, CRM allows you to remove Activities and Closed Activities from the forms customization window.





But when coming to Custom Entities the actual problem comes into picture, we cannot see the above options from forms customization window.






To hide Activities and Closed Activities Button from the ribbon we need to load below JavaScript to programmatically set the visibility is false for the Activities and Closed Activities.

function hideLeftNavItems() {
    Xrm.Page.ui.navigation.items.forEach(
function (item, index) {
        
var lblItem = item.getLabel();

         if (lblItem == "Activities" || lblItem == "Closed Activities") {
            item.setVisible(
false);
        }
    });
}

No comments:

Post a Comment