Posts

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 ...

Common Problems In DYnamics Axapta & Solutions

We have found that in a number of AOS crash cases they are resolved by installing the latest kernel hotfix. Therefore it is recommended that you consider implementing the latest kernel rollup as part of your maintenance. This could mean applying the latest kernel rollup once a quarter. Since the kernel hotfixes are cumulative, easy to uninstall, and do not include X++ fixes they are typically able to be installed with a lot less effort than an application hotfix. We do recommend that you apply the kernel rollup in a non-production environment and do some testing before applying it in your production environment. Please see the information from the  AX Kernel Patching  section on how to update to the latest kernel hotfix rollup. If you implement code when users are in the system you could have cache or data access issues that result in an AOS crash. Therefore, when implementing code in your production...

Optimistic Concurrency Control (OCC) Property in Dynamics Axapta

Definition Optimistic Concurrency Control (OCC) helps increase database performance. Pessimistic Concurrency Control locks records as soon as they are fetched from the database for an update. However, Optimistic Concurrency only locks records from the time when the actual update is performed. Pessimistic concurrency was the only option available in Microsoft Axapta 3.0 (now a part of Microsoft Dynamics). You can now choose which concurrency model to use—optimistic or pessimistic. RecVersion is a 32-bit signed INTEGER. But it will never get a negative  value assingned through the AOS. Advantages Fewer resources are used to hold the locks during the update process. Records are locked for a shorter length of time. Records remain available for other processes to update if they have been selected from the database but haven't yet been updated. Disadvantages The disadvantage of using OCC is that the update can fail if another process updates the same record. I...

Visual Studio 2008 does not contain the Dynamics AX EP Template

Once we installed the Visual Studio 2008 and AX Enterprise Portal Development tools in the Dynamics Ax 2009 Web server, we still cannot find any Dynamics AX template in the Visual Studio 2008 if we are using other accounts. The issue is caused by the AX template that is not deployed in Visual Studio 2008. The solution to fix that issue is to check the Application Data folder in the account which we are using to develop AX EP. In Windows 2003, we need to check those folder in the beneath: C:\Documents and Settings\usersaccount\Application Data\Microsoft\VisualStudio\9.0\ItemTemplatesCache\Visual Web Developer\CSharp C:\Documents and Settings\usersaccount\Application Data\Microsoft\VisualStudio\9.0\ProjectTemplatesCache\Visual Web Developer\CSharp\ If there are no folders or files in those two folder, we need to copy from the account who installed the Visual Studio 2008. The other issue is that we cannot see all the Dynamics AX control in the VS2008 Dynamics Ax tool box. The solution to...

Labels Files In Dynamics Axapta

If we look at our label files in the AOT we see 4 different extensions for our labels ·          ALI Axapta Label Index ·          ALC Axapta Label Comments ·         ALT Axapta Label Temp, Store ·          ALD Axapta Label Dictionary The ALD file is readable/editable with a text editor. General speaking you only need the ALD file. When the AOS is restarted the ALI and ALC will be generated on the fly.   (or update when the time stamp of the ALD file is bigger than the timestamp of the ALC or ALI file) Next, a developer creates new labels. These labels will be stored in the ALT file.  Not yet in the ALD file.  When the  final  AOS will stop. AX will update the ALD file this way. It will copy the ALD file to an ALB file. Next the changes in the ALT file will be stored in the ALB file....