This post is machine-translated. The original post in german language can be found here.

Caching display methods

The fact that display methods should be cached, when they are used in forms, is well-known. For this, a corresponding call should always be integrated into the init() method of a form datasource:

public void init()
{
    super();
    this.cacheAddMethod(tableMethodStr(DirPartyPostalAddressView,locationRoles));
}

 

The fact that you can save this call in Dynamics AX 2012, if you set a corresponding attribute in the display method itself, was new to me:

[SysClientCacheDataMethodAttribute(true)]
public client server display ExternalItemId defaultExternalItemId()
{
    return this.defaultCustVendExternalItemDescription().externalItemId();
}

This has the advantage that, no matter on how many forms the display method is used, I do not have to worry about the caching there anymore.

Additionally, there is the property CacheDataMethod avaiable for form controls, which also can be used to activate caching.  I prefer the variant using the attribute.

These post applies to following version:
Dynamics AX 2012

 
 

 

 
 
 
Posts of the actual month
November 2024
MoTuWeThFrSaSu
 123
45678910
11121314151617
18192021222324
252627282930 
 
© 2006-2024 Heinz Schweda | Imprint | Contact | German version | Desktop version
In order to provide you with better service, this site uses cookies. By continuing to browse the site, you are agreeing to our use of cookies.