SysFlushAOD: Refresh SysExtension cache in D365FO

SysFlushAOD: Refresh SysExtension cache in D365FO

The SysExtension framework is heavily used in warehouse mobile device development within Dynamics 365 for Supply Chain Management (SCM)  (see Process guide framework – Supply Chain Management | Dynamics 365 | Microsoft Learn). You may also find a short, self-contained example in my earlier blog:  X++ Decorator pattern in Dynamics 365.

There is one thing that annoys me every time: newly created classes fail to get invoked. The class factory does not recognize the new class because of the intensive caching of class IDs and attributes. A mobile warehouse solution may return “Process guide is not yet supported for this flow.“, for example. Rebuilding the solution does not clear the cache, and the class factory keeps an outdated list of derived classes, failing to instantiate them. The cache apparently survives even an IISRESET. 

Solution: Execute the following command in the browser, then reload:  https://xxxprod.operations.dynamics.com/?mi=SysClassRunner&cls=SysFlushAOD

This clears the SysExtension factory cache and rescans the list of inherited classes.