Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Custom View sort order

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

  • Suggested answer
    sandeepstw Profile Picture
    sandeepstw 4,601 on at
    RE: Custom View sort order

    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

  • Suggested answer
    Nithya Gopinath Profile Picture
    Nithya Gopinath 17,074 on at
    RE: Custom View sort order

    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.

  • TrevorB Profile Picture
    TrevorB 105 on at
    RE: Custom View sort order

    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.

  • gdas Profile Picture
    gdas 50,085 on at
    RE: Custom View sort order

    Hi Trevor,

    Could you please share screenshot what you did for sorting .

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans