编辑图表中的获取xml

时间:2012-11-03 18:55:57

标签: dynamics-crm dynamics-crm-2011

  <fetchcollection>
    <fetch mapping="logical" aggregate="true">
      <entity name="contact">
        <attribute groupby="true" alias="_CRMAutoGen_groupby_column_Num_0" name="hpcrm_currentsegmentid" />
        <order alias ="new_rank" descending="false"/>
        <attribute alias="_CRMAutoGen_aggregate_column_Num_0" name="hpcrm_revenue" aggregate="sum" />
        <attribute alias="_CRMAutoGen_aggregate_column_Num_13" name="hpcrm_aum" aggregate="sum" />
        <attribute alias="_CRMAutoGen_aggregate_column_Num_14" name="hpcrm_revenuelastyear" aggregate="sum" />
        <link-entity name="hpcrm_businesstier" from="hpcrm_businesstierid" to="hpcrm_currentsegmentid" alias="aa" > 
        </link-entity>
      </entity>
    </fetch>
  </fetchcollection>
  <categorycollection>
    <category alias="_CRMAutoGen_groupby_column_Num_0">
      <measurecollection>
        <measure alias="_CRMAutoGen_aggregate_column_Num_0" />
      </measurecollection>
      <measurecollection>
        <measure alias="_CRMAutoGen_aggregate_column_Num_13" />
      </measurecollection>
      <measurecollection>
        <measure alias="_CRMAutoGen_aggregate_column_Num_14" />
      </measurecollection>
      <measurecollection>
        <measure alias="new_rank" />
      </measurecollection>
    </category>
  </categorycollection>

我正在生成图表,但是想要按照该实体与n:1关系所在的另一个实体中存在的属性应用顺序。此处new_rank实体中存在businesstier属性。

<link-entity name="hpcrm_businesstier" from="hpcrm_businesstierid" 
  to="hpcrm_currentsegmentid" alias="aa" >

这里我将业务层加入联系实体。

但是当我尝试导入XML时,我收到了无效的XML错误。

  

指定的XML文件“Current Segment.xml的Revenue_AUM”也是   无效的XML或不符合图表架构

1 个答案:

答案 0 :(得分:0)

将您的订单声明移到链接实体中。不是你的查询,而是:

<fetch mapping="logical" count="50" version="1.0">
    <entity name="account">
        <attribute name="accountnumber" />
        <link-entity name="account" from="accountid" to="parentaccountid">
            <attribute name="accountnumber" />
            <order attribute="accountnumber" />
        </link-entity>
    </entity>
</fetch>