1.在crm对应的主数据库执行下面存储过程:

-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[usp_DisplayEntity](@entityName nvarchar(100), @LangId int=2052) AS
BEGIN
declare @EntityDisplayName nvarchar(100) SELECT top 1 @EntityDisplayName=l.Label FROM MetadataSchema.Entity e with(nolock)
LEFT JOIN MetadataSchema.LocalizedLabel l with(nolock) on e.EntityId =l.ObjectId AND l.ObjectColumnName ='LocalizedName'
WHERE l.Label is not null
and l.LanguageId =@LangId And ((l.IsManaged =1 and l.OverwriteTime <'2000/01/01' ) or l.IsManaged =0) and e.Name =@entityName if object_id('tempdb.dbo.#rs') is not null
drop table #rs
select Distinct @EntityDisplayName as EntityDisplayName, e.Name as EntityName , l.Label , a.PhysicalName,t.Description as AttributeType
,case when a.AttributeTypeId='00000000-0000-0000-00AA-110000000030' then dbo.ufn_MergePicklist (@entityName,a.Name,@LangId)
when a.AttributeTypeId='00000000-0000-0000-00AA-110000000013' then dbo.ufn_MergePicklist (@entityName,a.Name,@LangId) end
as PicklistValues,
case when a.AttributeTypeId='00000000-0000-0000-00AA-110000000031' then convert(nvarchar(100), f.Name)
when a.AttributeTypeId='00000000-0000-0000-00AA-110000000034' then convert(nvarchar(100), f.Name)
when a.AttributeTypeId='00000000-0000-0000-00AA-110000000035' then convert(nvarchar(100), f.Name) end as ReferencedEntityName,
a.Name as ColumnName ,
a.MaxLength,a.AttributeRequiredLevelId as IsRequired,
a.PrecisionSource,a.PrecisionValue, l.Label +'['+a.Name+']' as [Des],
l.Label +'['+e.Name +'.'+a.Name+']' as [DesFull],
lower(@entityName ) as EntitylogicalName into #rs
from MetadataSchema.Entity e with(nolock),
MetadataSchema.Attribute a with(nolock)
left join MetadataSchema.AttributeTypes as t with(nolock)on a.AttributeTypeId=t.AttributeTypeId
left join MetadataSchema.Entity f with(nolock)on a.ReferencedEntityObjectTypeCode=f.ObjectTypeCode
LEFT JOIN MetadataSchema.LocalizedLabel l with(nolock)
on a.AttributeId=l.ObjectId
ANd l.ObjectColumnName ='DisplayName'
and l.OverwriteTime<'1901/01/01'
WHERE e.Name =@EntityName
and e.EntityId=a.EntityId
AND l.Label is not null
and l.LanguageId=@LangId
order by l.Label select * from #rs
END

2.执行下面语句可以直接查看实体名称和字段描述:

exec usp_DisplayEntity @entityName='product',@LangId='',@type=1

效果:

最新文章

  1. 搭建自己私有的PKM系统,各家PKM大比拼。。附:构建自己熟悉的基础Docker,破解联通光猫
  2. git命令大全
  3. 手机 无法转移到SD卡 Andriod 导出应用程序
  4. swift:Optional Type 、Swift和Objective-C混编的讲解
  5. crontab使用和格式
  6. HTML5+MUI+HBuilder 之初探情人
  7. JSON对象、JSON字符串的相互转换
  8. Golang学习--包管理工具glide
  9. ip2long的用法
  10. 如何设置静态IP
  11. PAT1035: Password
  12. 用npm安装git上的项目
  13. 3.django Model
  14. c/c++ socket API 调用后的错误判断 perror errno
  15. nc--windows下工具分享
  16. go里面的指针用法
  17. Bootstrap3隐藏滑动侧边栏菜单代码特效
  18. iOS 第三方应用调用safari
  19. Luogu 2216[HAOI2007]理想的正方形 - 单调队列
  20. 很好的开源UI框架Chico UI

热门文章

  1. Linux命令:chown
  2. vue2.x学习笔记(十四)
  3. 【半译】在ASP.NET Core中创建内部使用作用域服务的Quartz.NET宿主服务
  4. Springboot:员工管理之删除员工及退出登录(十(9))
  5. Calendar日历类
  6. 5. 配置项:rule_files
  7. javascript-网页尺寸
  8. OC的消息机制简单介绍
  9. pip安装openvc-python国内镜像源
  10. linux 二级目录结构