Custom CRM 2011 chart does not sort by the aggregate value as defined in the xml

Answered Custom CRM 2011 chart does not sort by the aggregate value as defined in the xml

  • jueves, 26 de abril de 2012 20:08
     
      Tiene código

    I have a chart which was created in the GUI in CRM 2011, then exported to tweak a few things such as sort order and axis labels, and re-imported.

    It is supposed to sort by the aggregate value, just like the "top 10 customers" opportunity chart does (against which I have compared the xml very closely and see no difference), but it simply ignores the sort order. Setting descending = true or false doesn't make any difference.

    Chart is a simple column chart showing total of a custom field (happens to be a currency field), grouped by a custom option set field, and I want to sort it by the sum, ie rank the columns with the highest first and lowest last. XML below:

    <visualization>
      <visualizationid>{13B316E4-AE8F-E111-8B9A-000C2917CC01}</visualizationid>
      <name>Value by Category</name>
      <primaryentitytypecode>account</primaryentitytypecode>
      <datadescription>
        <datadefinition>
          <fetchcollection>
            <fetch mapping="logical" count="8" aggregate="true">
              <entity name="account">
                <attribute name="new_annualvaluecurrency" aggregate="sum" alias="Sum_AnnualValue" />
                <attribute name="new_customercategoryoptionset" groupby="true" alias="Category"  />
                <order alias="Sum_AnnualValue" descending="false" />
              </entity>
            </fetch>
          </fetchcollection>
          <categorycollection>
            <category>
              <measurecollection>
                <measure alias="Sum_AnnualValue" />
              </measurecollection>
            </category>
          </categorycollection>
        </datadefinition>
      </datadescription>

    NB: I am not trying to sort it by the category names / values - I know there are various threads where people have issues getting funnel charts to appear in the same order as the values in an option set. This is not the same scenario, I simply want a nice ranked chart.

    Anybody have any tips or code examples that work?


    Hope this helps. Adam Vero, MCT

Todas las respuestas