web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Clear cache with code (X++)

(0) ShareShare
ReportReport
Posted on by 6,648

Hi ALL,

How we can clear cache such as (record cache, global object cache, browser cache, various caches in SQL Server and many more,...) with Code?

Could you please give me sample code?

*This post is locked for comments

I have the same question (0)
  • Hossein.K Profile Picture
    6,648 on at
    RE: Clear cache with code (X++)

    Hi Galyna

    your answer is correct.

    Thanks

  • Jie G Profile Picture
    on at
    RE: Clear cache with code (X++)

    Hi Hossein,

    The job in https://gfeaxblog.wordpress.com/2017/12/14/ax-2012-clear-the-cache/ works fine in my test machine. Did you build it successfully? 

  • Galyna Fedorova Profile Picture
    3,566 on at
    RE: Clear cache with code (X++)

    Please change the quotes in the info. Instead of “, please use "

  • Martin Dráb Profile Picture
    235,876 Most Valuable Professional on at
    RE: Clear cache with code (X++)

    Please show the full error message, including the stack trace.

  • Hossein.K Profile Picture
    6,648 on at
    RE: Clear cache with code (X++)

    Hi Galyna,

    When I run your code(job),I face with this error:

    0312.Untitled.png

  • Verified answer
    Galyna Fedorova Profile Picture
    3,566 on at
    RE: Clear cache with code (X++)

    Try to check this link gfeaxblog.wordpress.com/.../ax-2012-clear-the-cache

  • Suggested answer
    Martin Dráb Profile Picture
    235,876 Most Valuable Professional on at
    RE: Clear cache with code (X++)

    A few examples:

    • SysFlush* classes
    • SysGlobalObjectCache::clearAllCaches()

    By the way, it's really "cache", not "cash".

  • Hossein.K Profile Picture
    6,648 on at
    RE: Clear cache with code (X++)

    Hi Martin,

    you can give a sample code for clear cashe which is access in x ++?

    I want to clear cashes which is access manualy(AOT/Tools/Cashes/...)

    Thanks.

  • Martin Dráb Profile Picture
    235,876 Most Valuable Professional on at
    RE: Clear cache with code (X++)

    Hi Hossein, only some caches are reachable from X++. For instance, you can remove entries from the global cache of your session, but you can't clear browser cache on the client machine.

    By the way, I fixed your spelling of cache (from "cash"); using the right spelling will help you when searching for existing information on internet.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Syed Haris Shah Profile Picture

Syed Haris Shah 9

#2
Mea_ Profile Picture

Mea_ 4

#3
Martin Dráb Profile Picture

Martin Dráb 2 Most Valuable Professional

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans