Skip to main content

Posts

Showing posts with the label table

How to Truncate Table from AX 2009?

1- go to the administration module 2- go to periodic menu 3- choose the SQL administration 4- choose the table you want truncate it from the all table collapse 5- click on the table action button 6- select truncate 7- click OK

Mass update on table properties

We all have run in trouble in the past when for a lot of tables the same update needs to be done: Below script can help you out. It will look in all tables that are in the database (SQLDictionary) Next it will find the related AOT Tree node. static void ChangeTableProperties(Args _args) { SQLDictionary dictionary; TreeNode treeNode; str properties; ; while select dictionary where dictionary.fieldId == 0 && dictionary.name like("Proj*") { treeNode = TreeNode::findNode('\\data dictionary\\tables\\'+dictionary.name); if (treeNode) { properties = treeNode.AOTgetProperties(); properties = setProperty(properties, 'CreatedDateTime', 'Yes'); properties = setProperty(properties, 'CreatedBy', 'Yes'); treeNode.AOTsetProperties(properties); treeNode.AOTsave(); } } }

Go To Main Table Functionality in Axapta

This is done by three ways: EDT Relations: If you use an EDT in tables which have relation with some other table fileds, that time you can able to navigate the main table or main form. FormRef Property: Select the Table and go to properties and select the required form in the FormRef property. JumpRef method: If you are not having that option, simply write a override the JumpRef method in a field of DataSource or in a Form Control. Here i show you a sample jumpRef method code: public void jumpRef() { Args args; MenuFunction menuFunction; ; args = new Args(); menuFunction = new MenuFunction(menuitemDisplayStr(“FormName”), MenuItemType::Display); args = new Args(menuFunction.object()); args.caller(element); args.record(“RecordName”); // to be a datasource which added in the current form menuFunction.run(args); } In the form init() which we called here, we have to check the condition whether the form is called by any dataset or not.

Open table from axapta x++

today, I want to share you a simple way to open a table from x++. static void DASTableBrowser(Args _args) SysTableBrowser sysTableBrowser = new SysTableBrowser(); ; //Browse the CustTable table sysTableBrowser.run(tablenum(CustTable)); ;