【发布时间】:2011-07-05 23:06:42
【问题描述】:
在 Dynamics CRM 中,我经常收到业务用户创建报告的要求。业务用户了解并谈论实体显示名称和属性标签。要编写查询,我需要将它们映射到 实体名称 和 属性名称。我想使用查询来查找。
我应该加入 dbo.LocalizedLabelView 视图以获取以下查询中的 AttributeLabel 列吗?我无法弄清楚 ObjectId 应该引用什么。 (如果你能告诉我你是如何找到答案的,我会特别感激!)
select
[EntityName] = entityNames.Name,
[EntityDisplayName] = entityDisplayNames.Label,
[AttributeName] = attributeNames.PhysicalName,
[AttributeDisplayName] = attributeDisplayNames.Label
--[AttributeLabel] = attributeLabels.Label
from
dbo.EntityView entityNames
inner join dbo.LocalizedLabelView entityDisplayNames
on entityDisplayNames.ObjectId = entityNames.EntityId
and entityDisplayNames.ObjectColumnName = 'LocalizedName'
left outer join dbo.AttributeView attributeNames
on attributeNames.EntityID = entityNames.EntityID
inner join dbo.LocalizedLabelView attributeDisplayNames
on attributeDisplayNames.ObjectId = attributeNames.AttributeID
and attributeDisplayNames.ObjectColumnName = 'DisplayName'
and attributeDisplayNames.LanguageID = entityDisplayNames.LanguageID
--inner join dbo.LocalizedLabelView attributeLabels
-- on attributeLabels.ObjectId = ?????
-- and attributeLabels.LanguageID = entityDisplayNames.LanguageID
where
entityDisplayNames.LanguageID = 1033
order by
entityDisplayNames.Label,
attributeDisplayNames.Label
【问题讨论】:
标签: sql label dynamics-crm reporting