【问题标题】:How do I use distinct in FetchXml and not produce ambiguous results?如何在 FetchXml 中使用 distinct 而不会产生模棱两可的结果?
【发布时间】:2019-07-27 12:20:19
【问题描述】:

当我有以下 FetchXml 时,如何应用 distinct='true'?它是否仅引用主实体记录,是否应该返回一条记录?或者给定 4 个与链接实体过滤器匹配的链接实体记录,它是否应该返回 4 条记录(即不同性是否应指完整的查询)?

我无法找到任何涵盖此内容的文档,也没有在 SO 上找到任何类似内容。

<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='true'>
  <entity name='primary-entity'>
    <attribute name='primary-entity-id />
    <attribute name='an-attribute'/>
    <filter type='and'>
      <condition attribute='an-attribute' operator='eq' value='something' />
    </filter>
    <link-entity name='linked-entity' from='primary-entity' to='primary-entity-id' alias='le'>
      <filter type='and'>
        <condition attribute='an-attribute' operator='in'>
          <value>1</value>
          <value>2</value>
          <value>3</value>
          <value>4</value>
        </condition>
      </filter>
    </link-entity>
  </entity>
</fetch>

【问题讨论】:

    标签: dynamics-crm distinct fetchxml


    【解决方案1】:

    “独特性”是指完整的查询,或者更确切地说是查询返回的所有属性。因此,如果您的情况下的链接实体记录不返回任何属性,则实际上不同的应该只“覆盖”主要实体。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-11-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-03-02
      相关资源
      最近更新 更多