26.06.2010, 01:09 | #1 |
Участник
|
paruvella: Form browser for Dynamics Ax-Tables
Источник: http://paruvella.spaces.live.com/Blo...4DB0!544.entry
============== In this example I am going to illustrate, a Form will be displayed, from the Table’s Context Menu. The form will show the records from selected table. We can call this form as Form Browser for tables. <font face="Calibri">I had created the following Class for displaying the Form browser from AOT-Tables. class PSShowFormForTable { } void createForm(TableId mytableId) { #AOT Args args; FormBuildDesign formBuildDesign; Form form; Formrun formrun; FormTabControl formTabControl; FormGroupControl formGroupControl; FormGridControl formGridControl; FormBuildDataSource formBuildDataSource; TreeNode treeNodeForm; TreeNode treeNodeTable; TreeNode treeNodeField; TreeNodeIterator iterator; FormBuildTabControl formBuildTabControl; FormBuildTabPageControl formBuildTabPageControl; FormBuildTabPageControl formBuildTabPageControl2; FormBuildGridControl formBuildGridControl; str fieldName; str caption; str myTableName; int i; DictTable dictTable; ; dictTable = new DictTable(mytableId); form = new Form(); form.name(dictTable.name()); myTableName = tableId2Name(mytableId); formBuildDataSource = form.addDataSource(myTableName); formBuildDataSource.table(mytableId); formBuildDataSource.allowCreate(true); formBuildDataSource.allowDelete(true); formBuildDataSource.allowEdit(true); formBuildDesign = form.addDesign("Design"); formBuildDesign.topMode(); // Auto formBuildDesign.leftMode(); // Auto formBuildDesign.widthMode(); // Auto formBuildDesign.heightMode(); // Auto formBuildDesign.windowType(); formBuildDesign.caption(dictTable.name()); formBuildDesign.titleDatasource(formbuilddatasource.id()); // 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, "Grid"); formBuildGridControl.dataSource(myTableName); formBuildGridControl.widthMode(1); // Column width formBuildGridControl.heightMode(1); // Column height treeNodeTable=TreeNode::findNode(#TablesPath + "\\" + myTableName + "\\Fields"); iterator=treeNodeTable.AOTiterator(); treeNodeField =iterator.next(); <font size="3"> while(treeNodeField && i
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|
|
Опции темы | Поиск в этой теме |
Опции просмотра | |
|