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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Forums / Finance forum / Display method caching
Finance forum

Display method caching

(0) ShareShare
ReportReport
Posted on by

Is display method caching relevant in D365FO?

I have the same question (0)
  • Jie G Profile Picture
    Microsoft Employee on at

    Hi SMC,

    D365FO allows to use SysClientCacheDataMethodAttribute attribute in the display method declaration. Then forms should cache such methods automatically.

    And when the display method is used in the form's control, if the cacheDataMethod property set to yes, the display method will be cached.

    Please refer: community.dynamics.com/.../create-display-method-to-table-extension-in-d365

  • Suggested answer
    Sukrut Parab Profile Picture
    71,735 Moderator on at

    Yes you can cache display method in D365FO

  • Community Member Profile Picture
    on at

    Thanks.

    How does display method caching work in D365FO? What's the effect? Is it different from AX12?

  • Verified answer
    Joris dG Profile Picture
    17,780 on at

    Great question. The caching will avoid _executing_ the display method unnecessarily. Since most display methods have some SQL query behind it (even if it's just a simple ::find()) this can quickly become a big performance improvement to cache just from a SQL perspective alone, since it would execute the method (and by extension, the SQL queries) every time a control is rendered on the form. So on a grid, this would be a lot of times (every row) and sometimes just a redraw of the screen (in AX2012 for example when resizing the form) could cause many calls and refreshes.

    I'll admit I'm not sure what kind of caching is done in the browser versus the server. But I think even if the caching is on the server only, the AX7 "client" in the browser only receives data updates when there are changes (i.e. it already has a built-in sort of caching/buffer mechanism) so avoiding the server to invalidate the cache on some fields should automatically avoid the data being sent back to the browser constantly. I may be butchering the actual implementation or details here, but I think it's a fairly good way to think about it.

    So yes, it's very much still relevant - for server/SQL performance as well as User Experience in the UI. With the connection between server and browser being further apart (cloud to local browser) than the traditional AX2012 client/server (typically on same network) as well as internet-connected clients potentially being on less reliable or low-bandwidth connections, data traffic (roundtrips) reductions are important.

  • Community Member Profile Picture
    on at

    Thanks Joris. Appreciate you taking the time to post a detailed response. Am sure others find this useful. :-)

  • Community Member Profile Picture
    on at

    Quick follow up. Would you go so far as to suggest that all display methods should be invariably decorated with SysClientCacheDataMethodAttribute? The Best practice checker seems to think so.

  • Verified answer
    Joris dG Profile Picture
    17,780 on at

    Only if you have some strange very dynamic display method is caching maybe not what you want. So most circumstances you'll want caching.

  • Mea_ Profile Picture
    60,286 on at

    I just want to add that it is not so important in D365 world. In 2012 almost any action could trigger display method refresh, so your main task was to reduce number of calls and you never worried about values refresh. Now, almost nothing triggers it and you have to write code explicitly using FormObservable to refresh them, you can read this blog post for details http://kashperuk.blogspot.com/2016/08/development-tutorial-formobservable-or.html

    And old guidance that can help you a lot - avoid display methods!

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Finance

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans