Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Records returned by a View - Dynamics 365

Posted on by

Hi Team,

I need to create a view showing only the 4 oldest cases without impacting other views.

How can I do that? Any suggestion?

The value of the number of returned records (4) may need to be configurable. How can I do it?

Thank you in advance!

Akrem

*This post is locked for comments

  • AKREM Profile Picture
    AKREM on at
    RE: Records returned by a View - Dynamics 365

    Thank you!

  • Verified answer
    ashlega Profile Picture
    ashlega 34,475 on at
    RE: Records returned by a View - Dynamics 365

    Well, you can't really.. the only option I see might be to create a plugin which would update that query in the pre-operation for retrieve multiple. That's sort of taking it too far, but I am not sure if there are any other options

  • AKREM Profile Picture
    AKREM on at
    RE: Records returned by a View - Dynamics 365

    Thank you Alex and Saad,

    The value of the attribute "Top" need to be configurable without access to the FetchXML query each time I need to change it. How can I do that?

    Thanks again!

    Akrem

  • Verified answer
    ashlega Profile Picture
    ashlega 34,475 on at
    RE: Records returned by a View - Dynamics 365

    Hi Akrem,

      there is "count" property in the fetchxml, which is an equivalent of SQL "TOP X":

    https://crmtipoftheday.com/2016/09/23/use-top-in-fetchxml/

      Unfortunately, you can't specify it for the views just like that, but you might use FetchXML Builder:

      http://fxb.xrmtoolbox.com/

      

      Or you might probably just add your entity/view to a new solution, export it, update the query in the customizations.xml file, and import it back.

     

      And yet another option, in case you only need to display those views in the subgrids.. Configure those subgrids to display 4 rows only (yes, there will be a pages then.. but it might be a compromise)

     

      

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Records returned by a View - Dynamics 365

    Use top 4 in your fetchxml. Refer this:

    crmtipoftheday.com/.../use-top-in-fetchxml

  • AKREM Profile Picture
    AKREM on at
    RE: Records returned by a View - Dynamics 365

    Hi, maybe I need to explain better my question.. The records to display is dynamic. So, for example if the view displays the 4 oldest cases: Case 1, Case 2, Case 3 and Case 4. If I delete Case 3 for example, so the view will display Case 1, Case 2, Case 4 and Case 5.

    I don't need to change the value of records by page for all views. I need only to change it for that specefic view.

    THANKS,

    AKREM

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Records returned by a View - Dynamics 365

    What is your purpose for that?

    Well, You could add a custom boolean field and set the field for those records you wanna show in your view.

    Then create a view for that field.

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!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans