How to Restart AOT in Dynamics Ax



Description:-

In this article we will see How to Restart AOT (Application Object Tree) using Job. Here we will Create Job and Restart AOT through Job.

Code:-

static void RestartAOT(Args _args)
{
    // update
    //—————————————-
    SysFlushSystemSequence::doFlush();
        SysEvent::fireEvent(SysEventType::FlushSystemSequence);
    info("@SYS73844");

    //Update dictionnary
    //—————————————-
    SysFlushDictionary::doFlush();
        SysEvent::fireEvent(SysEventType::FlushDictionary);
    info("@SYS68566");

    //Update log and compagnyinfos
    //—————————————-
    SysFlushDatabaseLogSetup::doFlush(curext());
            SysEvent::fireEvent(SysEventType::FlushDatabaseLogSetup,0,[curext()]);

    //—————————————-
    SysFlushData::doFlush();
    SysEvent::fireEvent(SysEventType::FlushData);
    info("@SYS98783");

    //Update AOD
    //—————————————-
    SysFlushAOD::doFlush(); //SysFlushAOD::clearMetadataCaches();
    SysEvent::fireEvent(SysEventType::FlushAOD);
    info("@SYS68564");
}

Related Posts

Previous
Next Post »

Thanks for comments.....