2016-12-16 102 views
0

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

<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> 

回答

2

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

+0

要增加Andrii Butenko提到的内容,可以很容易地从高级查找创建提取xml,以确保您获得所需业务所需的xml,并且不易出现像套管这样的错误。 – Renjith