CRM 2011:使用javascript向fetchXML查询插入条件

CRM 2011:使用javascript向fetchXML查询插入条件,javascript,dynamics-crm-2011,dynamics-crm,crm,Javascript,Dynamics Crm 2011,Dynamics Crm,Crm,我有以下获取XML查询: 我有业务需要,需要使用java脚本插入以下条件: 因此,最终的fetchxml如下所示: 你知道怎么做吗 感谢并致以最诚挚的问候。如果问题是为什么提取不起作用,可能是因为节点中嵌套了属性。试着这样做: <fetch mapping="logical"> <entity name="salesorder"> <attribute name="salesorderid"/> <attribute name

我有以下获取XML查询:


我有业务需要,需要使用java脚本插入以下条件:


因此,最终的fetchxml如下所示:


你知道怎么做吗


感谢并致以最诚挚的问候。

如果问题是为什么提取不起作用,可能是因为节点中嵌套了属性。试着这样做:

<fetch mapping="logical">
<entity name="salesorder">
    <attribute name="salesorderid"/>
    <attribute name="new_type"/>
    <attribute name="new_solomonswonumber"/>
    <attribute name="new_resolutioncode"/>
    <attribute name="new_rentalsaleindicator"/>
    <attribute name="new_preferredphone"/>
    <attribute name="name"/>
    <attribute name="new_equipment"/>
    <attribute name="customerid"/>
    <order attribute="new_type" descending="false"/>
    <filter type="and">
        <condition attribute="salesorderid" operator="eq" value="5AC5CBAC-25A0-E211-92B3-00155D815016"/></filter>
    <link-entity name="new_entity" from="new_entityid" to="new_entitylookup">
        <filter type="and">
            <condition attribute='new_entityid' operator='eq' value='10ad18f6-c384-e211-b04d-78e3b50834b8'/>
        </filter> 
        <attribute name="new_street1"/>
        <attribute name="new_province"/>
        <attribute name="new_postalcode"/>
        <attribute name="new_city"/>
    </link-entity>
</entity></fetch>

):


var regex=new RegExp(/So)您的问题是如何连接xml是Javascript?还是提取xml不起作用?
var regex = new RegExp(/<link-entity.*name=[\"\']new_entity[\"\'].*>.*<filter[^>]*>/);

fetch = fetch.replace(regex, '$&' + newCondition)