Hello World,
If you are in trouble with unnecessary Entities in your Advance Find (that you created while ago and no longer needed) but you don't want to remove them. And you want to hide them from your customers. And you are too lazy and you want one query that works for all. :)
I was that lazy.
EntityMetadata.IsValidForAdvancedFind Property
- Gets or sets whether the entity will be shown in Advanced Find
if IsValidForAdvancedFind = 1
then referring entity will be shown in Advance Find.
Therefore to hide a entity from Advance Find we can write -
update MetadataSchema.Entity
set IsValidForAdvancedFind = 0
where Name = 'EntityName'
Above will hide the contact entity for all users on the advanced.
Then to hide the Entity been displayed under related Entities we can write,
update MetadataSchema.Relationship
set IsValidForAdvancedFind = 0
where ReferencingEntityId = (select
MetadataSchema.Entity.EntityId
from MetadataSchema.Entity
where Name = 'EntityName') and IsValidForAdvancedFind
= 1)
If you have multiple Entities to update you can easily change the '=' to 'IN' and write all the Entities as a array.
update MetadataSchema.Entity
set IsValidForAdvancedFind = 0
where Name IN ('EntityName1', 'EntityName2', ......)
Hope this would be useful
Mathee
No one can lie, no one can hide anything, when he looks directly into someone's eyes. See the link below for more info.
ReplyDelete#hide
www.ufgop.org
Is it working on Dynamics CRM Online, or just in onprem versions? If yes, where can I run this update? Thank you
ReplyDeleteHi Robert,
DeleteThe update has to be run on the CRM database. I worked on a on-premise. But I think you can still backup online db, run the queries and restore it back