Posts

Delete All Transaction in Dynamics Axapta 2012

How to delete all transactions from AX 2012. Previously we were using SysDatabaseTransDelete class to do the same but as of now we need to modify that class to work properly with AX 2012 due to DB changes : We need to modify the SysDatabaseTransDelete.handletable method with the below code : void handleTable(SysDictTable sysDictTable) {     TableGroup      tableGroup;     if (tableSet.in(sysDictTable.id()))         return;     tableSet.add(sysDictTable.id());     if (sysDictTable && !sysDictTable.isTmp() && !sysDictTable.isMap())     {         tableGroup = sysDictTable.tableGroup();         // Handle company specific tables to be deleted         if (sysDictTable.dataPrCompany())         {             switch(tableGroup)           ...

All tables have Primary index Cluster index Caching

Self diagnostics   this Script will check if all tables have  Primary index  Cluster index Caching //NOTE: temp tables are skipped static void TableTuningTest(Args _args) {     boolean         skipEmptyTables = true;     boolean         result;     treeNode        treeNode;     SysDictTable    sdt;     str             TableAndCound;     int             recordCount;     boolean         skipEmptyrecordCount = false;     treeNodeIterator treeNodeIterator =TreeNode::findNode("\\Data Dictionary\\Tables").AOTiterator();     ;     treeNode = treeNodeIterator.next();     setPrefix("Tuning");     while (treeNode)     {         sdt  = new SysDictTable(tablename...

Details Of Axapta Enums,Tables , Classes , Interface.

http://schunk.dk/DocWeb2009/class%20index.html

Error saying that MSSQL 2005 SP2 is required,while Installing AX 2009 Reporting Extensions

Installing AX 2009 Reporting Extensions in MSSQL 2008 & WIN 2008 When we try to install AX 2009 SP1 Reporting Services on a PC running SQL 2008, we get an error saying that MSSQL 2005 SP2 is required. Well there is a solution to this issue which is as follows: 1. Locate the AX Reporting services dll from the extracted AX 2009 SP1 folder [\\AX2009SP1\support\axsetupresources\microsoft.dynamics.setup.reportingservices.dll;File Version - 5.0.1000.52] 2. Copy the microsoft.dynamics.setup.reportingservices.dll into the folder: \\DynamicsAX\Msi\Components32\Program Files\Microsoft Dynamics AX\50\Setup [since my system is 32-bit so Components32] 3. It will ask to replace the existing dll having File Version - 5.0.593.0. Say Yes and replace. Now, carry on with the installation process.

Enable Windows event Log In Axapta

I have implemented Dynamics AX Event Logs in Test environment, This can be particularly useful when you would like to use the Windows Event Log to monitor AX batch Jobs. For getting this feature enabled,I have added a new static method called writeLogEntry to the Global class: static void writeLogEntry(Exception e, str caller, int line, str text) { // Use the standard .NET class EventLog from // the System.Diagnostics assembly System.Diagnostics.EventLog eventLog; // Also use a .NET enumeration from the // System.Diagnostics assembly System.Diagnostics.EventLogEntryType entryType; System.Exception clrException; str stack; Batch batch; str batchInfo; ; try { // Create a new object of the EventLog class eventLog = new System.Diagnostics.EventLog(); eventLog.set_Source("Dynamics AX"); // Set the enumeration value based on the Exception // type in AX switch (e) { case Exception::Info : entryType = System.Diagnostics.Even...

Number Sequence Getting Skipped in Ax

We have gone through the number sequence issue that we are facing in Axapta. Below are my findings on the issue, Please suggest how to proceed on this issue. Continuous:- Select this check box for a continuous sequence.(if this is selected system will generate continues number sequence, which is selected in our Case) Cleanup - When this option is selected, the number sequence is cleaned up automatically.(this option is selected in Our case) This option is automatically selected when the number sequence is continuous (it is ticked in our case), and should not be cleared. For continuous number sequences, the next available number from the sequence is used when a transaction is entered. If a number is generated but the transaction fails, automatic cleanup allows the number to be used again. You can set up a time interval for automatic cleanup in the Interval field. (In Our case Time Interval is set to 24 hours which according to Microsoft is a Best Practice) Ro...

Performance Issues IN Axapta

Include a try catch around all transactions that could result in deadlock. Make sure the try for a deadlock is idempotent meaning no matter how many times the try is attempted, it will yield the same result. Consider the clarity when deciding the number of return statements in a method. Use throw instead of ttsAbort. Avoid display methods where possible. Set Optimistic Concurrency Control (OccEnabled) to Yes for most tables. Do not include user interaction inside a database transaction. Keep database transactions as short as possible. Run code on the Application Object Server (AOS) whenever possible. Use where clauses in select statements and in queries that align with indexes. If method calls are used to test conditions, put the method calls after the other conditions. If the other conditions fail, then you will not incur the cost of running the method. Minimize the size of database transactions. Consider specifying a field list in ...