Microsoft Dynamics 365 我可以使用 FetchXML 通过 guid 检索实体吗?

Microsoft Dynamics 365 can I use FetchXML to retrieve an entity by guid?

鉴于我有一个 GUID 和一个实体类型,我可以使用 FetchXML 查找实体吗?

为什么以下看似明显的 FetchXML 不起作用?

<fetch>
  <entity name="user_entity" >
    <filter>
      <condition attribute="id" operator="eq" value="cb92c01d-8676-4f41-a5cf-8967cc9de0d9" />
    </filter>
  </entity>
</fetch>

确保 GUID 对该实体记录有效。我只是在 Dev Account 实体中快速测试了 XrmToolBox 中 FetchXML Builder 的结果(没有任何问题)。

<fetch version="1.0" output-format="xml-platform" mapping="logical" >
  <entity name="account" >
    <filter type="and" >
      <condition attribute="accountid" operator="eq" value="882E3BF1-97F9-E911-A813-000D3A5A1A59" />
    </filter>
  </entity>
</fetch>

也类似于您的查询:

<fetch>
  <entity name="account" >
    <filter>
      <condition attribute="accountid" operator="eq" value="882E3BF1-97F9-E911-A813-000D3A5A1A59" />
    </filter>
  </entity>
</fetch>

GUID 也不区分大小写。

<fetch>
  <entity name="account" >
    <filter>
      <condition attribute="accountid" operator="eq" value="882e3bf1-97f9-e911-a813-000d3a5a1a59" />
    </filter>
  </entity>
</fetch>