gpt4 book ai didi

php - Dynamics CRM 2011 SOAP RetrieveMultiple 查询忽略条件

转载 作者:可可西里 更新时间:2023-11-01 13:54:49 25 4
gpt4 key购买 nike

我正在使用 PHP 和 SOAP 连接到 Dynamics CRM 2011 Online,但遇到了一个问题。以下 RetrieveMultiple 忽略我的条件并返回所有记录。

我想要的是所有以“test@test.com”作为电子邮件地址的联系人。

有人可以告诉我下面的标准/条件有什么问题吗?

谢谢!

<RetrieveMultiple xmlns="http://schemas.microsoft.com/xrm/2011/Contracts/Services">
<query xmlns:b="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" i:type="b:QueryExpression">
<b:ColumnSet>
<b:AllColumns>false</b:AllColumns>
<b:Columns xmlns:c="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<c:string>firstname</c:string>
</b:Columns>
</b:ColumnSet>
<b:Criteria>
<b:Conditions>
<b:Condition>
<b:AttributeName>emailaddress1</b:AttributeName>
<b:Operator>Equal</b:Operator>
<b:Values>
<b:Value i:type="xsd:string">test@test.com</b:Value>
</b:Values>
</b:Condition>
</b:Conditions>
<b:FilterOperator>And</b:FilterOperator>
<b:Filters />
</b:Criteria>
<b:Distinct>false</b:Distinct>
<b:EntityName>contact</b:EntityName>
<b:LinkEntities />
<b:PageInfo>
<b:Count>250</b:Count>
<b:PageNumber>1</b:PageNumber>
<b:PagingCookie i:nil="true" />
<b:ReturnTotalRecordCount>false</b:ReturnTotalRecordCount>
</b:PageInfo>
</query>
</RetrieveMultiple>

最佳答案

尝试使用以下 SOAP 格式:

    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<Execute xmlns="http://schemas.microsoft.com/xrm/2011/Contracts/Services" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<request i:type="a:RetrieveMultipleRequest" xmlns:a="http://schemas.microsoft.com/xrm/2011/Contracts">
<a:Parameters xmlns:b="http://schemas.datacontract.org/2004/07/System.Collections.Generic">
<a:KeyValuePairOfstringanyType>
<b:key>Query</b:key>
<b:value i:type="a:QueryExpression">
<a:ColumnSet>
<a:AllColumns>false</a:AllColumns>
<a:Columns xmlns:c="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<c:string>firstname</c:string>
</a:Columns>
</a:ColumnSet>
<a:Criteria>
<a:Conditions>
<a:ConditionExpression>
<a:AttributeName>emailaddress1</a:AttributeName>
<a:Operator>Equal</a:Operator>
<a:Values xmlns:c="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<c:anyType i:type="d:string" xmlns:d="http://www.w3.org/2001/XMLSchema">abc@a.com</c:anyType>
</a:Values>
</a:ConditionExpression>
</a:Conditions>
<a:FilterOperator>And</a:FilterOperator>
<a:Filters />
<a:IsQuickFindFilter>false</a:IsQuickFindFilter>
</a:Criteria>
<a:Distinct>false</a:Distinct>
<a:EntityName>contact</a:EntityName>
<a:LinkEntities />
<a:Orders />
<a:PageInfo>
<a:Count>0</a:Count>
<a:PageNumber>0</a:PageNumber>
<a:PagingCookie i:nil="true" />
<a:ReturnTotalRecordCount>false</a:ReturnTotalRecordCount>
</a:PageInfo>
<a:NoLock>false</a:NoLock>
</b:value>
</a:KeyValuePairOfstringanyType>
</a:Parameters>
<a:RequestId i:nil="true" />
<a:RequestName>RetrieveMultiple</a:RequestName>
</request>
</Execute>
</s:Body>
</s:Envelope>

顺便说一句。您可以使用位于 SDK\samplecode\cs\client\soaplogger 中的 SOAPLogger 来获取正确的 SOAP 表达式。

关于php - Dynamics CRM 2011 SOAP RetrieveMultiple 查询忽略条件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17985429/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com