【发布时间】:2013-12-01 07:13:09
【问题描述】:
我想要一个显示 3 个实体的属性的视图:
统计信息具有对帐户的查找,而帐户具有对地址的查找。
该视图是关于统计的,我想要所有 3 个实体的属性;这甚至可能吗?
问题出在 GridXML。
我想在 GridXML 中包含 wl_city 属性。
这是带有链接实体的 FetchXML:
<fetchxml>
<fetch version="1.0" output-format="xml-platform" mapping="logical">
<entity name="sb_statistics">
<order attribute="sb_amount" descending="false" />
<!-- It is easy to get these into the GridXML -->
<attribute name="sb_debtor" />
<attribute name="sb_date" />
<attribute name="sb_amount" />
<link-entity name="account" from="accountid" to="sb_debtor"
alias="relatedAccount" link-type="outer">
<!-- It is possible to get this into the GridXML
by using the link-entity alias: relatedAccount.wl_towncity -->
<attribute name="wl_towncity" />
<link-entity name="wl_postalcode" from="wl_postalcodeid"
to="wl_postaltowncity" alias="relatedAddress" link-type="outer">
<!-- I have trouble getting this attribute into the GridXML -->
<attribute name="wl_city" />
</link-entity>
</link-entity>
<attribute name="sb_statisticsid" />
</entity>
</fetch>
</fetchxml>
当我如下更改 GridXML 时,打开视图时会显示此错误:
"要使用此保存的查询,您必须删除引用已删除或不可搜索项的条件和列"
<layoutxml>
<grid name="resultset" object="10008" jump="sb_name" select="1" preview="1"
icon="1">
<row name="result" id="sb_statisticsid" multiobjectidfield="1">
<cell name="sb_amount" width="100" />
<cell name="sb_date" width="100" />
<cell name="sb_debtor" width="100" />
<cell name="relatedAccount.relatedAddress.wl_city" width="100" />
</row>
</grid>
</layoutxml>
以下 GridXML 在打开视图时显示此错误:
“意外错误发生错误”。
<layoutxml>
<grid name="resultset" object="10008" jump="sb_name" select="1" preview="1"
icon="1">
<row name="result" id="sb_statisticsid" multiobjectidfield="1">
<cell name="sb_amount" width="100" />
<cell name="sb_date" width="100" />
<cell name="sb_debtor" width="100" />
<cell name="relatedAddress.wl_city" width="100" />
</row>
</grid>
</layoutxml>
下面的 GridXML 导致在打开视图时显示此错误:
“要使用此保存的视图,您必须删除引用已删除或不可搜索列的条件和列”。
<layoutxml>
<grid name="resultset" object="10008" jump="sb_name" select="1" preview="1"
icon="1">
<row name="result" id="sb_statisticsid" multiobjectidfield="1">
<cell name="sb_amount" width="100" />
<cell name="sb_date" width="100" />
<cell name="sb_debtor" width="100" />
<cell name="wl_city" width="100" />
</row>
</grid>
</layoutxml>
这个保存的查询有效,但它只包含来自主实体和第一个链接实体的属性。
<savedquery>
<IsCustomizable>1</IsCustomizable>
<CanBeDeleted>0</CanBeDeleted>
<isquickfindquery>0</isquickfindquery>
<isprivate>0</isprivate>
<isdefault>0</isdefault>
<returnedtypecode>10008</returnedtypecode>
<savedqueryid>{df101ac4-2e4d-e311-9377-005056bd0001}</savedqueryid>
<layoutxml>
<grid name="resultset" object="10008" jump="sb_name" select="1" preview="1"
icon="1">
<row name="result" id="sb_statisticsid" multiobjectidfield="1">
<cell name="sb_amount" width="100" />
<cell name="sb_date" width="100" />
<cell name="sb_debtor" width="100" />
<cell name="relatedAccount.wl_city" width="100" />
</row>
</grid>
</layoutxml>
<querytype>0</querytype>
<fetchxml>
<fetch version="1.0" output-format="xml-platform" mapping="logical">
<entity name="sb_statistics">
<order attribute="sb_amount" descending="false" />
<attribute name="sb_debtor" />
<attribute name="sb_date" />
<attribute name="sb_amount" />
<link-entity name="account" from="accountid" to="sb_debtor"
alias="relatedAccount" link-type="outer">
<attribute name="wl_towncity" />
<link-entity name="wl_postalcode" from="wl_postalcodeid"
to="wl_postaltowncity" alias="relatedAddress" link-type="outer">
<attribute name="wl_city" />
</link-entity>
</link-entity>
<attribute name="sb_statisticsid" />
</entity>
</fetch>
</fetchxml>
<LocalizedNames>
<LocalizedName description="Statistics and Address" languagecode="1033" />
</LocalizedNames>
</savedquery>
GridXML 是否仅限于显示主要实体和第一个链接实体的属性?
【问题讨论】:
-
我无法谈论 GridXML 的任何限制,但
relatedAddress.wl_city是您应该使用的正确别名。 -
您能否通过高级查找创建个人视图并查看gridxml 在SQL 表中的样子?
-
@Andy 我只能从第一个链接实体添加列。
-
这似乎是 GridXML 有史以来最严重的限制,我可以很好地显示来自 fetchxmlbuilder 的数据,它返回所有多嵌套链接实体及其所有字段的所有字段,包括 relatedAddress.wl_city 但是如何让该结果集在 GRidXML 中工作?到目前为止,我发现的唯一选择是采用相同的 FetchXML 并改用 RDL SSRS CRM 在线报告。但是这些报告太慢了。我想要快速查看的。
标签: dynamics-crm-2011 dynamics-crm fetchxml