web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Blogs / Simple AX / warmup Ax rich client opening

warmup Ax rich client opening

Daniele Ferraretto Profile Picture Daniele Ferraretto

Hi everybody, I have managing an arragement from a suggestion from an Internet post about to warmup richclient opening of Ax.
In fact this not solve definetively the opening of client but permits a cache of some object.
Leave here for your interest.

Bye.

Below the code :

static void WarmupFORMOpen(Args _args)
{
//This code is for “warming” up forms and code I have in the VAR-layer
UtilElements e;
TreeNode treeNode;
FormRun formRun;
SysUtilElementsLog SysUtilElementsLog;

DialogField dlgStatic, dlgDinamic, dlgUsageCount, dlgReport;
Dialog d = new Dialog(“@SYS59973”);
Args args = new Args();

d.addGroup(“@SYS133633”);
dlgStatic = d.addFieldValue(extendedTypeStr(NoYesId), NoYes::Yes, “@SYS133633”);

d.addGroup(“@SYS53674”);

dlgDinamic = d.addFieldValue(extendedTypeStr(NoYesId), NoYes::Yes, “@SYS53674”);
dlgUsageCount = d.addFieldValue(extendedTypeStr(NumberOf), 1000, “@SYS2828”);

d.addGroup(“@SYS4005107”);
dlgReport = d.addFieldValue(extendedTypeStr(NoYesId), NoYes::Yes, “@SYS4005107”);

d.run();

if(!d.closedOk())
return;

//———————— warmup for argument —————————————
if(dlgStatic.value() == NoYes::Yes)
{
while select e
where e.utilLevel == UtilEntryLevel::usr //<– spesify layer here
&& e.recordType == UtilElementType::Form //<– and only forms
&& (
e.name like "cust*" ||
e.name like "vend*" ||
e.name like "sales*" ||
e.name like "vend*" ||
e.name like "invent*" ||
e.name like "ecores*" ||
e.name like "prod*"//<– I only want the forms that starts with the prefix
)
{
try
{
treeNode = xUtilElements::getNodeInTree(xUtilElements::parentElement(e));
args.name(treeNode.AOTname());
formRun = ClassFactory.formRunClass(args);
formRun.init();
//formRun.run(); // dlgUsageCount.value()
&& !(SysUtilElementsLog.Name like “sys*”)
{
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;
}
}
}

if(dlgReport.value() == NoYes::Yes)
new SRSReportServerWarmup().runSRSReportServerWarmupReport();
}



This was originally posted here.

Comments

*This post is locked for comments