Add AND statement to WHERE clause in FETCH XML?

一世执手 提交于 2019-12-12 04:31:10

问题


We have this below fetchXML, I have a quick question wondering how I add this and statement to the WHERE clause: and ip.pcssu_quantityavailable >= sod.quantity - sod.quantityshipped to the 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>

回答1:


I'm afraid that FetchXml doesn't support such syntax. I'm really sorry for that. Also to make your fetch work use your entity names lowercased like salesorder and salesorderdetail (not SalesOrder and SalesOrderDetail).



来源:https://stackoverflow.com/questions/41181726/add-and-statement-to-where-clause-in-fetch-xml

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!