Sort on Related Column in a View

 Introduction: 

When we create a view, We can configure the sort but the sorting is available only for the columns which are a part of the entity on which the view is created.

Eg: In the active accounts view, there is a column " Email" which is a field from Contact Entity. If we see the columns available for sorting we cannot see Email.

Graphical user interface, application, Word

Description automatically generated

However, in case you want to sort on a column from the related entity we can do it using the view designer and Fetch Xml builder tools from the XRM Toolbox.

 

Solution:

On load of My active accounts, the default sort is on Account Name

A screenshot of a computer

Description automatically generated with medium confidence

 

Open View Designer on XRM Toolbox

Graphical user interface, text, application

Description automatically generated

Click on Edit Query to open Fetch XML Builder

Graphical user interface, text, application

Description automatically generated

We can see the order attribute is on name

Graphical user interface, text, application

Description automatically generated

Now, we can edit and add order attribute to emailaddress1

Graphical user interface, text, application

Description automatically generated

After you click on Return FetchXML, you will return back to view designer. Then click on edit XML and remove the disable sorting on the attribute.

Graphical user interface, text, application, email

Description automatically generated

You can now save and Publish. 

 The View My active accounts will be by default sorted by email address in ascending order.

Graphical user interface, application

Description automatically generated

 


Comments

Popular posts from this blog

The supplied reference link is invalid Error in Cloudflows

Set Dynamic Recipients of D365 Email in Power Automate

Retrieve Email Recipients (TO, CC, BCC) in Cloud Flow