Table duplication

Hi all,

In the below code I created a duplicate table. But how can I pass that duplicate table in dictTable = new DictTable(—???–);


DictTable dictTable;#### Common common;#### dialogSource = dialog.addField(extendedTypeStr(TableName),“DataSourceTable”);#### treeNode = TreeNode::findNode(#TablesPath);#### treeNode.AOTfindChild(dialogSource.value()).AOTDuplicate();#### SqlDataDictionary::synchronize();

dictTable = new DictTable(—???–);#### common = dictTable.makeRecord();

Thanks & Regards,

Rk.

AOTDuplicate() returns another TreeNode instance and you can get the new name by treeNodeName() - it will be CopyOf*. Then you have to either convert the name to table ID (tableName2Id()) or to create the instance by SysDictTable::newName().

May I ask what problem are you trying to solve by duplicating tables at runtime?

Hi Martin,

My requirement is copy the selected records from a form grid and save into a StoringTable . Here I need to create the table(StoringTable ) dynamically and this table structure same as form grid datasource table structure. For this I am trying to duplicate the grid datasource table. Please let me know is there any way with out duplicating the table. And my Ax version is R2 CU6.

Thanks & Regards,

Rk.

Forget about storing tables and form grids and tell me what’s the business requirement.

In a form select some records and when we click on a form button on that time a is table created with that selected records.