在dynamics 365 中,看字段的描述需要到系统字段设置里面才能看到,这里提供一种sql直接看字段和实体名描述的方法
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='2052',@type=1
效果:
记得收藏并关注,掌握更多相关知识!!!
分类:
Dynamics 365
, Sql Server
标签:
SQL Server
, Dynamic 365
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· [.NET]调用本地 Deepseek 模型
· 一个费力不讨好的项目,让我损失了近一半的绩效!
· .NET Core 托管堆内存泄露/CPU异常的常见思路
· PostgreSQL 和 SQL Server 在统计信息维护中的关键差异
· C++代码改造为UTF-8编码问题的总结
· 实操Deepseek接入个人知识库
· CSnakes vs Python.NET:高效嵌入与灵活互通的跨语言方案对比
· 【.NET】调用本地 Deepseek 模型
· Plotly.NET 一个为 .NET 打造的强大开源交互式图表库
· 上周热点回顾(2.17-2.23)