Caching form into AOS to increase performance for Dynamics AX


Normally when we open form for the first time in Dynamics AX, it will take sometimes to compilte and cache into AOS. That’s why at second time always faster. If we often restart AOS, how can we keep performance ?


After restart AOS we can let some scripts run to open up some often used forms then cache to AOS, then close those forms.

Here is the code

static void WarmupRF(Args _args)

    UtilElements e;
    TreeNode treeNode;
    FormRun formRun;

    Args args = new Args();

    while select e
        where e.utilLevel  == UtilEntryLevel::var    //<-- specify layer here
        &&    e.recordType == UtilElementType::Form  //<-- and only forms
        && like "nameofformPrefix"

                treeNode = xUtilElements::getNodeInTree(xUtilElements::parentElement(e));
                formRun = ClassFactory.formRunClass(args);
                //;   //<-- No need to run the form, but sometimes it can load the data

Max Nguyen

Max Nguyen
D365/AX, Azure Solution Architech - currently living and working in Seoul :)

Exception Handling in Dynamics 365 For Finance and Operation

When we write a code, or make a customization to Dynamics 365 For Operation which is using X++ should make use of Exception Handling to p...… Continue reading

Basic C# OOP Concept

Published on April 10, 2017