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)

Custom View sort order

(0) ShareShare
ReportReport
Posted on by 105

Hi
Using Dynamic 365 online. I am trying to create a custom view that will display accounts in the order they are searched for but cant get it to work.
For instance
AccountName = Microsoft
OR
AccountName = IBM
OR
AccountName = Hewlett Packard
Returns in that order
Microsoft
IBM
Hewlett Packard
I tried just removing the <order attribute = “Name”.. hoping this would return the records in the order of the query but it seems to return records by ‘Record created date’ instead. Is there anyway to get the records returned in the order as the query states. Searched a number of websites but haven’t found an answer.

Would appreciate any advice.

*This post is locked for comments

I have the same question (0)
  • gdas Profile Picture
    50,091 Moderator on at

    Hi Trevor,

    Could you please share screenshot what you did for sorting .

  • TrevorB Profile Picture
    105 on at

    Hi Goutam

    Thanks for your reply

    Advanced find screenshot below

    AdvancedFindView.JPG

    I didn’t set any sorting for this however when I examined the fetchxml its seem that it sets a default order <order attribute="name" descending="false" />

    Below is the full query. Using the FetchXML builber in XRMToolbox I removed the order attribute hoping this would return the records in the same order as the query. 

    <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false" >

      <entity name="account" >

        <attribute name="name" />

        <attribute name="primarycontactid" />

        <attribute name="telephone1" />

        <attribute name="accountid" />

        <order attribute="name" descending="false" />

        <filter type="and" >

          <filter type="or" >

            <condition attribute="name" operator="eq" value="Microsoft" />

            <condition attribute="name" operator="eq" value="IBM" />

            <condition attribute="name" operator="eq" value="Hewlett Packard" />

            <condition attribute="name" operator="eq" value="ABC Company" />

          </filter>

        </filter>

      </entity>

    </fetch></fetch>

    When I run the query in CRM, it returns the accounts in the following order (get the same result when running from FetchXML builder)

    AdvancedFindView.JPG

    I thought initially this order was related to ‘Record created date’ but it could be the auto generated AccountID as I am guessing these would be sequential identifiers which would return the same effect as by date. It dosnt matter what order I use in the advance find It still retruns the same result in the view.

    I am just trying to return the records in the view window in the same order they are set out in the advanced find criteria but not sure if this is even possible.  

    Hope this all makes sense and again thanks for your reply and appreciate your help.

  • Suggested answer
    Nithya Gopinath Profile Picture
    17,078 on at

    Hi Trevor,

    Click on Edit columns in the Advanced Find command bar as shown below.

    81404.Capture1.PNG

    Click on Configure Sorting.

    81404.Capture1.PNG

    Here you can give the sorting order in the descending order of name.

    8512.Capture2.PNG

    Hope this helps.

  • Suggested answer
    sandeepstw Profile Picture
    4,601 on at

    Hi,

    By default, It supports only two columns. You can also check this article to customize sorting priority.

    www.powerobjects.com/.../customize-sorting-priority-in-views-in-crm-2011

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