javascript - XrmServiceToolkit.SOAP.RetrieveMultiple 查询 CRM 2016

标签 javascript soap crm xrm

我做了一个查询,从 CRM 获取所有具有特定用户 guid 或今天到期的报告。 所以等效的 if 语句是:

if(ownerid == userGuid || novemo_date == today) {...}

如何进行这种查询:

if(ownerid == userGuid && (novemo_date == today || novemo_date == yesterday)){...}

这是我的查询:

var query = "<a:ColumnSet>" +
                            "<a:AllColumns>true</a:AllColumns>" +
                            "</a:ColumnSet>" +
                        "<a:Criteria>" +
                          "<a:Conditions />" +
                          "<a:FilterOperator>Or</a:FilterOperator>" +
                          "<a:Filters>" +
                            "<a:FilterExpression>" +
                              "<a:Conditions>" +
                              "<a:ConditionExpression>" +
                                  "<a:AttributeName>ownerid</a:AttributeName>" +
                                  "<a:Operator>Equal</a:Operator>" +
                                  "<a:Values xmlns:b='http://schemas.microsoft.com/2003/10/Serialization/Arrays'>" +
                                    "<b:anyType i:type='c:string' xmlns:c='http://www.w3.org/2001/XMLSchema'>" + userGuid + "</b:anyType>" +
                                  "</a:Values>" +
                                "</a:ConditionExpression>" +
                                "<a:ConditionExpression>" +
                                  "<a:AttributeName>novemo_date</a:AttributeName>" +
                                  "<a:Operator>Equal</a:Operator>" +
                                  "<a:Values xmlns:b='http://schemas.microsoft.com/2003/10/Serialization/Arrays'>" +
                                    "<b:anyType i:type='c:string' xmlns:c='http://www.w3.org/2001/XMLSchema'>" + today + "</b:anyType>" +
                                  "</a:Values>" +
                                "</a:ConditionExpression>" +
                              "</a:Conditions>" +
                              "<a:FilterOperator>Or</a:FilterOperator>" +
                              "<a:Filters />" +
                            "</a:FilterExpression>" +
                          "</a:Filters>" +
                        "</a:Criteria>" +
                        "<a:Distinct>false</a:Distinct>" +
                        "<a:EntityName>novemo_timereport</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>";

最佳答案

使用SOAP logger ,然后您可以用 C# 编写您的逻辑,记录器将为您输出请求/响应 XML。

关于javascript - XrmServiceToolkit.SOAP.RetrieveMultiple 查询 CRM 2016,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37695879/

相关文章:

java - 2 个插件在 pom 中不能同时工作

javascript - 无法获取未定义或空引用查找字段的属性 '0'

crm - 如何让浏览器通过 Five9 发出调用信号?

javascript - 对多种产品使用一个 Google Checkout 按钮

javascript - 防止 NoUISlider 工具提示重叠

java - 具有基本身份验证的 JAX-WS 请求

WCF 身份验证策略

powershell - 在 PowerShell 中连接到 CRM 2016 IFD

javascript - 如何在 Chrome 扩展中使用 Javascript 保护或隐藏 oAuth CLIENT_SECRET?

javascript - Uncaught Error bootstrap 需要在 bootstrap.min.js 处使用 jquery