我使用FetchXML在CRM 2011中查询数据以在SSRS 2008中构建报告。我的查询有效,但它不会返回链接到null实体的记录。这是我的查询:
<fetch>
<entity name="appointment">
<attribute name="scheduledstart" />
<link-entity name="systemuser" from="systemuserid" to="ownerid">
<attribute name="firstname" alias="ownerFirstName" />
<attribute name="lastname" alias="ownerLastName" />
</link-entity>
<link-entity name="contact" from="contactid" to="new_contactperson">
<attribute name="parentcustomerid" alias="parentaccount" />
<attribute name="new_businessunit" alias="businessunit" />
</link-entity>
<attribute name="new_contactperson" />
<attribute name="subject" />
<attribute name="new_coldernotes" />
<link-entity name="activityparty" from="activityid" to="activityid">
<attribute name="participationtypemask" alias="participationtypemask" />
<filter>
<condition attribute="participationtypemask" operator="eq" value="9" />
</filter>
<link-entity name="systemuser" from="systemuserid" to="partyid">
<attribute name="fullname" />
</link-entity>
</link-entity>
<filter type="and">
<condition attribute="scheduledstart" operator="on-or-after" value="@FromDate" />
<condition attribute="scheduledstart" operator="on-or-before" value="@ToDate" />
</filter>
</entity>
</fetch>
例如,在链接到systemuser或contact的位置,如果这些记录为null,则不会返回约会记录。是否有返回记录,即使它链接到空?
谢谢!
答案 0 :(得分:5)
想出来。需要添加link-type =“outer”。