首页 > 数据库技术 > 详细

CRM sql 查询

时间:2016-03-04 13:04:46      阅读:309      评论:0      收藏:0      [点我收藏+]

查询实体信息:

--查询实体信息,实体名称:account select * from MetadataSchema.Entity where name= ‘account‘

技术分享

查询窗体信息:

--查询窗体信息,ObjectTypeCode: 实体的code select * from systemform where ObjectTypeCode = 1

技术分享

查询视图信息:

--查询视图信息,ReturnedTypeCode:实体的code select * from SavedQuerybase where ReturnedTypeCode = 1

技术分享

 

查询字段信息:

--查询字段信息 with attr as(    select * from MetadataSchema.Attribute as a    where a.EntityId in (select entityid from MetadataSchema.Entity    where name = ‘new_member‘) and a.IsCustomField = 1 ) select a.attributeid,a.Name,label.Label,ty.Description, (select top 1 name from MetadataSchema.Entity where EntityId in ( select ship.ReferencedEntityId from MetadataSchema.Relationship as ship where ship.ReferencingAttributeId = a.AttributeId)) as ‘lookName‘ from attr as a inner join MetadataSchema.LocalizedLabel as label on a.attributeid = label.objectid inner join MetadataSchema.AttributeTypes as ty on a.AttributeTypeId = ty.AttributeTypeId where label.objectcolumnname = ‘DisplayName‘ and a.validforcreateapi = 1

技术分享

查询关系信息: select * from MetadataSchema.Relationship where ReferencingEntityId in (select top 1 entityid from MetadataSchema.Entity where name = ‘new_store‘)

技术分享

 

CRM sql 查询

原文:http://www.cnblogs.com/guozh-bk/p/5241640.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!