Dynamics AX 2012: Warming up for presales demo

To really impress potential buyers of Dynamics AX, it is important that we are capable to show that AX 2012 responds fast. We normally use the Contoso hyper-v demo environment, and our laptops have limited resources. Starting a demo on a cold system, we often see that forms takes some time to operate in optimal performance. If you already have opened a form, it is much faster the second time you open it.

So how can we give the users a view of a fast system without manually opening all the forms prior to the demo?

We can warm them up J. I use the following job-script to open and close all the forms I’m planning to use. I just traverse through the AOT, and open the form, and then I close them again.

static void WarmupRF(Args _args)
{
    //This code is for "warming" up all RF* forms and code I have in the VAR-layer
    UtilElements e;
    TreeNode treeNode;
    FormRun formRun;
    Args args = new Args();

    while select e
        where e.utilLevel  == UtilEntryLevel::var    //<-- spesify layer here
        &&    e.recordType == UtilElementType::Form  //<-- and only forms
        &&    e.name like "RF*"                      //<-- I only want the forms that starts with the prefix RF*
        {
            try
            {
                treeNode = xUtilElements::getNodeInTree(xUtilElements::parentElement(e));
                args.name(treeNode.AOTname());
                formRun = ClassFactory.formRunClass(args);
                formRun.init();
                //formRun.run();   //<-- No need to run the form, but sometimes it can load the data
                formRun.close();
            }
            catch
            {
                Infolog.clear();
                continue;
            }
        }
}

The code must be modified to suit what you want to “warm-up”, but you get the idea.

This will make you demo go much more smooth, and you truly show the potential and performance of a warm Dynamics AX system.

Happy DAX’ing

4 thoughts on “Dynamics AX 2012: Warming up for presales demo

  1. Hello Kurt,

    great tip, this is going to save me a lot of “clicks” prior to each presales demo.

    many thanks for sharing
    Sven

    Like

    • Thanks Sven. Here is another “version” of the code, where it load the 30 most used forms, based on the Element usage log (SysUtilElementsLog);
      SysUtilElementsLog SysUtilElementsLog;
      FormRun formRun;
      Args args;
      int i;

      args = new Args();

      while select Name from SysUtilElementsLog order by UseCount desc
      where SysUtilElementsLog.Type == UtilElementType::Form
      && SysUtilElementsLog.UseCount > 0
      && !(SysUtilElementsLog.Name like “sys*”)
      {
      i++;

      if (i>30)
      break;
      else
      print strFmt(“Warming up %1”, SysUtilElementsLog.Name);

      try
      {
      args.name(SysUtilElementsLog.Name);
      formRun = ClassFactory.formRunClass(args);
      formRun.init();
      //formRun.run(); //<– No need to run the form, but sometimes it can load the data
      formRun.close();
      }
      catch
      {
      Infolog.clear();
      continue;
      }
      }
      pause;

      Like

Leave a reply to Sven De Coninck Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.