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

Add comment
 
 

 

 
 
 
Posts of the actual month
Mai 2024
MoTuWeThFrSaSu
 12345
6789101112
13141516171819
20212223242526
2728293031 
 
© 2006-2024 Heinz Schweda | Imprint | Contact | German version | Mobile 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.