AX 2012 tip: How to clear cache Job
If you are experiencing trouble clearing cache in AX 2012, AX 2012 R2, and AX 2012 R3 use the following:
static void ClearCaches_arb(Args _args)
{
;
new MenuFunction(menuItemActionStr(SysFlushReportServer), MenuItemType::Action).run(); //report server
new MenuFunction(menuItemActionStr(SysFlushDictionary), MenuItemType::Action).run();
// dictionary
new MenuFunction(menuItemActionStr(SysFlushData), MenuItemType::Action).run(); // data
new MenuFunction(menuItemActionStr(SysFlushAOD), MenuItemType::Action).run();// elements
}