Hiding a System/Custom entity Programatically RRS feed

  • Question

  • Hi 
    Is there a way to put a veil on a System/Custom entity so that it doesn't appear in any of the instances in CRM Programatically , i have tried the unsupported way of hiding Account entity from Advanced find using 

    hide-entity-from-advanced-find   as cited in the blog, it just hides the entity from Advanced find, my requirement is to obliterate the visibility of that entity? but it has to be available whenever needed.
    I just need the Entity to go clandestine !!! Is it Possible to do so?

    1. I have tried to use SiteMap but it hides entities only on Nav Bar panel, not in edit windows of entities that have relationships with the entity I am hiding.

    2. Another way is to hide it in SiteMap, then manually hide relationships on each form. But it is very exhausting; takes a lot of time and you have to be very attentive to remove all relationships. Also if you want to return the entity you need again return it on all forms

    3. Tried to hide them using security roles. I have added all standard roles (except System Administrator) to solution and just removed all privileges on each role to the entity. This is the best method I think because it hides entity everywhere and you don’t think about forms. But system administrator will still see the entities. And what to do if customer will add its own role from System Administrator's account that will have access to the entity

    Thanks in advance, 

    Wednesday, July 23, 2014 1:14 PM

All replies

  • Use of security roles is the main non-code option, but you can't get around the fact that this won't apply to System Administrators.

    An alternative approach is to use a plugin on the Retrieve and RetrieveMultiple messages which checks what entity is being accessed, and if it's the entity that you want to hide, remove any data from the relevant OutputParameter. However, this also has limitations - the plugins don't fire when data is accessed via a report.

    Otherwise, you could try encrypting the data that is stored in the entity, again using a plugin, though this time on the Create and Update messages.

    If none of these work, and you really want to hide the data, you might find it best not to store it in CRM, but somewhere else, such as a separate SQL Database (though you then have to consider that anyone with the sysadmin SQL server role can see all SQL data)

    Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk

    Wednesday, July 23, 2014 9:30 PM