Caching the display methods on Forms in AX 2009
AX Forms with many display methods might have some performance issues. To increase the performance of these kinds of AX forms, the display method written in the table methods need to registered for caching.
-
Locate the form that the method is used on.
-
Expand the Data Sources node.
-
Right-click the data source that the method is associated with, and then select Override Method > init.
-
Call the this.cacheAddMethod method after the call to super() in the init method.
The first parameter for cacheAddMethod determines the name of the method to be cached. The second parameter (set to true by default) determines whether the value of thedisplay method is updated when a record is written to the database.
The example is as follows:
public void init()
{
super();
this.cacheAddMethod(tablemethodstr(SalesTable,customerName)); }
The above method has been overridden in the SalesTable dataSource's init() method. So, by adding this method, this method will registered into client cache and thus the performance of the form with display methods will be increased.
Note : Only table display methods can be cached. Display Methods written on the form or the form data source cannot be cached and also edit methods cannot be cached.