Thursday 22 November 2012

How to open a form in runtime in Ax 2012

Hi Friends,

Today we are going to open a form in runtime in Ax 2012.

There are two ways of opening a form in runtime in Ax 2012.
Below given codes are for just example.

The first type of opening a form is given below

client static Object OpenToolBar()
{
Object toolBarForm = null;
Args args = new Args();
;
args.name(formStr(formName));
toolBarForm = classFactory.formRunClass(args);
toolBarForm.init();
toolBarForm.run();
toolBarForm.detach();
return toolBarForm;
}

The second type is given below

client static Object getToolBarObject()
{
ObjectIdent objIdent = infolog.globalCache().get(formStr(formname),null,null);
Object toolBarForm = objIdent ? objIdent.object() : null;
;
if(!toolBarForm)
{
toolBarForm = S3SecurityToolBarOpen::OpenToolBar();
}
else
toolBarForm.setActive();

return toolBarForm;
}

Vivek Chirumamilla

No comments:

Post a Comment