Form classes in AX 2012.

static void createForm(Args _args)
{
Args args;

Form form;
FormRun formRun;
FormBuildDesign fbDesign;
FormBuildDataSource fbDS;
FormBuildGridControl fbGrid;
FormBuildTabControl fbTab;
FormBuildTabPageControl fbTabPage1;
DictTable dictTable;
FormControlType fctTabPage = FormControlType::TabPage;
FormControlType fctTab = FormControlType::Tab;
FormControlType fctGrid = FormControlType::Grid;
form = new Form();
dictTable = new DictTable(tablenum(VendTable));
fbDS = form.addDataSource(dictTable.name());
fbDS.table(dictTable.id());
fbDesign = form.addDesign(“Design”);
fbDesign.caption(“Customer information”);
fbTab = fbDesign.addControl(fctTab, “Overview”);
fbTabPage1 = fbTab.addControl(fctTabPage, “Overview”);
fbTabPage1.caption(“Overview”);
fbGrid = fbTabPage1.addControl(fctGrid,”Table Grid”);
fbGrid.addDataField(fbDS.id(),
dictTable.fieldName2Id(“AccountNum”));
fbGrid.addDataField(fbDS.id(),
dictTable.fieldName2Id(“BankAccount”));
fbGrid.addDataField(fbDS.id(),
dictTable.fieldName2Id(“BidOnly”));
args = new Args();
args.object(form);
formRun = classfactory.formRunClass(args);
formRun.run();
formRun.detach();
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s