zoukankan      html  css  js  c++  java
  • CRM sql 查询

    转自博友"菜刀-soft"!


    查询实体信息:

    --查询实体信息,实体名称: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')

  • 相关阅读:
    低效代码的危害
    使用datetime来控制timer的问题
    redis for windows
    log4net支持用日期加时间指定文件名
    防止数据丢失的解决方法
    RabbitMQ默认情况下不保证每次都把消息传递
    UnitTest和Developer
    spring+eureka+zuul
    新工具解决消息丢失的bug
    java_if_else__的应用1
  • 原文地址:https://www.cnblogs.com/guozh-bk/p/5241640.html
Copyright © 2011-2022 走看看