17.09.2012, 17:11 | #1 |
Участник
|
ax-erp: Create Forms by Using Code
Источник: http://microsoft-dynamics-ax-erp.blo...sing-code.html
============== static void createForm(Args _args) { Args args; Form form; FormRun formRun; FormBuildDesign formBuildDesign; FormBuildDataSource formBuildDataSource; FormBuildGridControl formBuildGridControl; FormBuildStringControl formBuildStringControl; FormBuildStringControl formBuildStringControl2; FormBuildTabControl formBuildTabControl; FormBuildTabPageControl formBuildTabPageControl; FormBuildTabPageControl formBuildTabPageControl2; FormStringControl formStringControl; FormGridControl formGridControl; DictTable dictTable; int idx; int idx2; int idx3; ; // Create the form header. form = new Form(); // Add a data source to the form. ID 77 refers to the CustTable. dictTable = new DictTable(tablenum(CustTable)); formBuildDataSource = form.addDataSource(dictTable.name()); formBuildDataSource.table(dictTable.id()); // Create the form design. formBuildDesign = form.addDesign("Design"); formBuildDesign.caption("myForm"); // Add tabbed page controls, a grid control, and string controls. formBuildTabControl = formBuildDesign.addControl(FormControlType::Tab, "Overview"); formBuildTabPageControl = formBuildTabControl.addControl(FormControlType::TabPage, "Overview"); formBuildTabPageControl.caption("Overview"); formBuildTabPageControl2 = formBuildTabControl.addControl(FormControlType::TabPage,"Details"); formBuildTabPageControl2.caption("Details"); formBuildGridControl = formBuildTabPageControl.addControl(FormControlType::Grid,"Table Grid"); formBuildStringControl = formBuildTabPageControl2.addControl(FormControlType::String,"Table String"); formBuildStringControl2 = formBuildTabPageControl2.addControl(FormControlType::String,"Table String"); // Add data fields to controls. formBuildGridControl.addDataField (formBuildDataSource.id(),dictTable.fieldName2Id("AccountNum")); formBuildGridControl.addDataField (formBuildDataSource.id(),dictTable.fieldName2Id("Phone")); formBuildGridControl.addDataField (formBuildDataSource.id(),dictTable.fieldName2Id("Name")); formBuildGridControl.addDataField (formBuildDataSource.id(),dictTable.fieldName2Id("Address")); formBuildStringControl.dataSource(formBuildDataSource.id()); formBuildStringControl.dataField(2); formBuildStringControl2.dataSource(formBuildDataSource.id()); formBuildStringControl2.dataField(3); args = new Args(); args.object(form); // Create the run-time form. formRun = classfactory.formRunClass(args); formRun.run(); formRun.detach(); } Источник: http://microsoft-dynamics-ax-erp.blo...sing-code.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|
|
|