In this post I would like to share the job. The purpose of this job is to clear Local Cache. Every time when I see doubtful behavior, I run this job to make sure that AX is not misbehave.
static void RefreshLocalCache(Args _args)
{
xSession::removeAOC();
SysTreeNode::refreshAll();
SysFlushDictionary::main(null);
SysFlushAOD::main(null);
SysFlushData::main(null);
SysBPCheckAIFDataObject::flushCache(true);
SysFlushReportServer::main(null);
SysFlushSystemSequence::main(null);
xSession::updateAOC();
info(“ok”);