Caching Display Methods

In AX 2012 there are two ways of caching display methods on form.

 

The first way is to add attribute to display method itself:

 

[SysClientCacheDataMethodAttribute([_updateOnWrite])]
Display Type methodname(Params)
{

}

 

The second way is to call cacheAddMethod after super() call:

 

public void init()
{
super();
this.cacheAddMethod(tablemethodstr(methodName));
}