web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

CRM Chart Sort order on linked entity - options set field

(0) ShareShare
ReportReport
Posted on by 4,130

Hi,

I'm using CRM 2016 on premise. trying to set the sort order for a chart.

The chart is based on a view that use the case entity as primary entity and the account as linked entity

The field that I'm trying set the chart order by originate from the linked entity

I have exported the chart xml and added the line in red below  then imported the xml back however I do not see any impact

Not sure if I'm missing anything:

<fetchcollection>
        <fetch mapping="logical" aggregate="true">
          <entity name="incident">
            <link-entity name="account" from="accountid" to="customerid" link-type="outer">
              <attribute groupby="true" alias="_CRMAutoGen_groupby_column_Num_0" name="new_accountgroup" />
   <order alias="_CRMAutoGen_groupby_column_Num_0" name="new_accountgroup" descending="false"/>
            </link-entity>
            <attribute alias="_CRMAutoGen_aggregate_column_Num_0" name="incidentid" aggregate="count" />
    
          </entity>
        </fetch>
      </fetchcollection>

*This post is locked for comments

I have the same question (0)
  • Alaa Ramadan Profile Picture
    4,130 on at

    I just want to add, the current sort order seems to be based on the option set value instead of the label.

    I thought this was an old bug that has been fixed on the newer version of CRM

  • Community Member Profile Picture
    on at

    How about rearrange the option set in the customization as a workaround?

  • Alaa Ramadan Profile Picture
    4,130 on at

    Do you mean re-arranging the display order? i tried it this already and it has no impact.

    If you mean overriding the values? Cannot do this since it has been used and referenced by other entities 

    Regards 

  • Community Member Profile Picture
    on at

    Anyone have an update on this string?  I'm in D365 online, and running into the same thing.  My chart is sorting on the value of the option set, not the label, which is pretty useless.  Is there a way to get it to sort on the label?

  • Suggested answer
    Muhammadusman12 Profile Picture
    4 on at
    I came to the same requirement from the client as you mentioned where I have to sort the chart using linked entity attribute(lastname), I have done this using below Fetchxml for it.
     
      <datadescription>
        <datadefinition>
          <fetchcollection>
            <fetch mapping="logical" aggregate="true" count="30">
              <entity name="new_case">
                <order alias="_CRMAutoGen_aggregate_column_Num_0" descending="false" />
                <attribute name="new_opsopen" aggregate="count" alias="_CRMAutoGen_aggregate_column_Num_0" />
                <attribute name="new_opsassigned" aggregate="count" alias="_CRMAutoGen_aggregate_column_Num_14" />
                 <link-entity name="systemuser" from="systemuserid" to="new_siuspecialist2" link-type="inner" >
                 <attribute name="lastname" alias="_systemusera_column_Num_0" groupby='true'/>
                 <order  alias="_systemusera_column_Num_0" descending="false" />
                 </link-entity>
              </entity>
            </fetch>
          </fetchcollection>
          <categorycollection>
            <category alias="_systemusera_column_Num_0">
              <measurecollection>
                <measure alias="_CRMAutoGen_aggregate_column_Num_0" />
              </measurecollection>
              <measurecollection>
                <measure alias="_CRMAutoGen_aggregate_column_Num_14" />
              </measurecollection>
            </category>
          </categorycollection>
        </datadefinition>
      </datadescription>


     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans