Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

SysClientCacheDataMethodAttribute vs SysClientCacheDataMethod

(0) ShareShare
ReportReport
Posted on by 4,125

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,

  • Blue Wang Profile Picture
    Blue Wang on at
    RE: SysClientCacheDataMethodAttribute vs SysClientCacheDataMethod

    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.

    108.png

    [SysClientCacheDataMethod]
    public display LineAmount lineAmount()
    {
       return CurrencyExchangeHelper::amount(this.Price * this.QtyInstructNow, this.CurrencyCode);
    }

  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 230,934 Most Valuable Professional on at
    RE: SysClientCacheDataMethodAttribute vs SysClientCacheDataMethod

    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).

  • Gunjan Bhattachayya Profile Picture
    Gunjan Bhattachayya 35,421 on at
    RE: SysClientCacheDataMethodAttribute vs SysClientCacheDataMethod

    Hi Yuji,

    You should use [SysClientCacheDataMethodAttribute(true)] for caching.

    I am not sure about the other attribute ([SysClientCacheDataMethod(true)]).

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,111 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,934 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans