首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >FetchXML -未返回记录

FetchXML -未返回记录
EN

Stack Overflow用户
提问于 2014-01-31 22:22:21
回答 1查看 226关注 0票数 1

我有一个FetchXML查询,它根据所有者用户所从事的业务以及机会成功的概率返回所有记录。我报告的所有字段都是必填字段,将被填写。我遇到的问题是,我的一个关联帐户- "new_dealerid“帐户可能并不总是填满,如果我包括这个,我只得到31条记录(所有人都有经销商),如果我没有,我得到32条(只有新的没有经销商)。那么,如果没有相关的帐户,有没有人知道如何将该属性设为空字符串或其他值?

代码语言:javascript
复制
<request i:type="b:RetrieveMultipleRequest" xmlns:b="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
            <b:Parameters xmlns:c="http://schemas.datacontract.org/2004/07/System.Collections.Generic">
                <b:KeyValuePairOfstringanyType>
                    <c:key>Query</c:key>
                    <c:value i:type="b:FetchExpression">
                        <b:Query>&lt;fetch mapping="logical" version="1.0" &gt;&#xD;
                            &lt;entity name="opportunity"&gt;&#xD;
                                &lt;attribute name="estimatedvalue" /&gt;&#xD;
                &lt;attribute name="name" /&gt;&#xD;
                &lt;attribute name="new_opportunitytype" /&gt;&#xD;
                &lt;attribute name="new_salesphase" /&gt;&#xD;
                &lt;attribute name="estimatedclosedate" /&gt;&#xD;
                &lt;link-entity name="systemuser" from="systemuserid" to="ownerid"&gt;&#xD;
                    &lt;attribute name="fullname"/&gt;&#xD;
                &lt;/link-entity&gt;
                &lt;link-entity name="account" from="accountid" to="new_dealerid"&gt;&#xD;
                    &lt;attribute name="name"/&gt;&#xD;
                &lt;/link-entity&gt;
                &lt;link-entity name="account" from="accountid" to="customerid"&gt;&#xD;
                    &lt;attribute name="name"/&gt;&#xD;
                &lt;/link-entity&gt;
                &lt;filter type="and"&gt;
                &lt;condition attribute="salesstagecode" operator="eq" value="'.$prob.'" /&gt;
                &lt;condition attribute="statuscode" operator="eq" value="1" /&gt;
                &lt;/filter&gt;
                &lt;link-entity name="systemuser" from="systemuserid" to="ownerid"&gt;&#xD;
                    &lt;link-entity name="businessunit" from="businessunitid" to="businessunitid"&gt;&#xD;
                &lt;filter type="and"&gt;
                    &lt;condition attribute="name" operator="eq" value="'.$bu.'" /&gt;
                &lt;/filter&gt;
                &lt;/link-entity&gt;
                &lt;/link-entity&gt;
                            &lt;/entity&gt;&#xD;
                        &lt;/fetch&gt;</b:Query>
                    </c:value>
                </b:KeyValuePairOfstringanyType>
            </b:Parameters>
            <b:RequestId i:nil="true"/><b:RequestName>RetrieveMultiple</b:RequestName>
    </request>
EN

回答 1

Stack Overflow用户

发布于 2014-02-01 04:37:26

需要说明的是,您想要获取全部32条记录?

在这种情况下,您将需要使用外部联接。

代码语言:javascript
复制
<link-entity name="account" from="accountid" to="new_dealerid" link-type="outer">
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21482307

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档