Hi,
If I would like to cache the display method in D365, should I use [SysClientCacheDataMethodAttribute(true)] or [SysClientCacheDataMethod(true)]? What is the difference between these two?
Thanks,
Hi Yuji,
They can all implement the cache the display method.
You can first look at the description of these methods:http://kashperuk.blogspot.com/2015/05/tutorial-caching-display-methods.html
For SysClientCacheDataMethod, But there is no information about the new SysClientCacheDataMethod attribute which should be used instead of cacheAddMethod on the form. Form this:https://github.com/MicrosoftDocs/dynamics-365-unified-operations-public/issues/2116
(I am not sure about it)
But I found that when I received the following BP "BPCheckDisplayMethodCached: Display method methodName on control LineAmount in form FormName not cached", I set the Cache Data Method property at the form control level to Yes.
And add the attribute [SysClientCacheDataMethod on the table method, it also works normally.
[SysClientCacheDataMethod] public display LineAmount lineAmount() { return CurrencyExchangeHelper::amount(this.Price * this.QtyInstructNow, this.CurrencyCode); }
It's the same thing.
When you're decorating something with an attribute, you can either provide the whole class name (SysClientCacheDataMethodAttribute) or you can omit 'Attribute' at the end (SysClientCacheDataMethod).
Hi Yuji,
You should use [SysClientCacheDataMethodAttribute(true)] for caching.
I am not sure about the other attribute ([SysClientCacheDataMethod(true)]).
André Arnaud de Cal...
292,111
Super User 2025 Season 1
Martin Dráb
230,934
Most Valuable Professional
nmaenpaa
101,156