Monday, December 8, 2014

Get list of Entities in CRM query by Display Name (CRM bulk update)

Hello World,


MetadataSchema.Entity does not have the Display Name of the Entity in it. To get Display Name of a Entity we have to use MetadataSchema.LocalizedLabel
In the bellow query I get the all Entities where Entity Display Name starts from 'Z'.

select distinct e.Name, e.LogicalName, e.OriginalLocalizedName, OptionSetValue.Label
from MetadataSchema.Entity as e inner join
MetadataSchema.LocalizedLabel as OptionSetValue on (e.EntityId = OptionSetValue.ObjectId and
OptionSetValue.ObjectColumnName = 'LocalizedName')
where OptionSetValue.Label like 'Z%'
order by OptionSetValue.Label

With this we can easily get a list of entities and can do other necessary implementations in bulk. 


For example this is a good input to the query in below link,
http://matheeid.blogspot.com/2014/12/bulk-hide-entities-from-advance-find-in.html


No comments:

Post a Comment