zoukankan      html  css  js  c++  java
  • crmsql句子的实体关系实体字段的信息窗口

    在crm里面怎样用sql语句查询这些信息?

    查询实体信息:

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

     

     

    版权声明:本文博客原创文章,博客,未经同意,不得转载。

  • 相关阅读:
    css 动态换肤
    javascript 传递中文乱码的解决方案
    Iframe自动适应宽度和高度(both IE and Firefox )
    asp.net 读取Excel
    使用 sp_executesql
    用Javascript实现鼠标拖拽网页表单[转]
    教你看别人的QQ密码
    ASP.NET设置数据格式总结(二)[转]
    老百姓上的三大当[转]
    showModalDialog()、showModelessDialog()方法使用详解[转]
  • 原文地址:https://www.cnblogs.com/mfrbuaa/p/4655628.html
Copyright © 2011-2022 走看看