O'Reilly logo

Microsoft Dynamics AX 2012 Development Cookbook by Mindaugas Pocius

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Caching a display method

In Dynamics AX, display methods are widely used to show additional information on forms or reports that come from different data sources, including special calculations, formatting, and more.

Display methods are shown as physical fields and are executed each time the form is redrawn. This means that the more complex the method is, the longer it takes to display it on the screen. Normally, it is recommended to keep the code in display methods to a minimum.

The performance of display methods can be improved by caching them. This is when display method's return value is retrieved from a database or calculated only once, and subsequent calls are made to the cache.

In this recipe, we will create a new cached display method. We ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required