【问题标题】:Add AND statement to WHERE clause in FETCH XML?在 FETCH XML 的 WHERE 子句中添加 AND 语句?
【发布时间】:2017-05-02 02:13:30
【问题描述】:

我们在 fetchXML 下面有这个,我有一个小问题想知道如何将这个和语句添加到 WHERE 子句中: and ip.pcssu_quantityavailable >= sod.quantity - sod.quantityshipped 到 fetchXML?

<fetch mapping="logical" version="1.0">
  <entity name="SalesOrder">
    <attribute name="ordernumber" />
    <attribute name="statuscode" />
    <attribute name="statuscodename" />
    <attribute name="pcssu_stockavailable" />
    <filter>
      <condition attribute="statuscode" operator="eq" value="141560004" />
    </filter>
    <link-entity name="SalesOrderDetail" from="salesorderid" to="salesorderid" alias="sod" link-type="inner">
      <attribute name="productidname" />
      <attribute name="quantity" />
      <attribute name="quantityshipped" />
      <link-entity name="pcssu_inventoryproduct" from="pcssu_product" to="productid" alias="ip" link-type="inner">
        <attribute name="pcssu_quantityavailable" />
      </link-entity>
    </link-entity>
    <link-entity name="account" from="accountnumber" to="pcssu_servicecentrecode" alias="a" link-type="inner" />
  </entity>
</fetch>

【问题讨论】:

    标签: dynamics-crm crm fetchxml


    【解决方案1】:

    恐怕 FetchXml 不支持这种语法。我真的很抱歉。此外,为了使您的获取工作使用小写的实体名称,如 salesorder 和 salesorderdetail(而不是 SalesOrder 和 SalesOrderDetail)。

    【讨论】:

    • 补充一下 Andrii Butenko 提到的内容,可以很容易地从高级查找中创建 fetch xml,以确保您获得的 xml 是业务需要的,并且不太容易出现诸如大小写之类的错误。跨度>
    猜你喜欢
    • 2013-12-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多