Posts

Showing posts from 2012

Find out S-ID in Axapata.

Some times we may need to update SID for a particular user in Axapta 2009.the easy way to find out SID:- 1. Type Regedit in run dialog 2. you can find the SID in the following Path HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\S-1-5-21-1942122889-2631018838-3300784370-500. 3. go to SQL in dbo.Userinfo table and update the Userid And the SID.

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)             {                 case TableGroup::Transaction:                 case TableGroup::WorksheetHeader:                 case TableGroup::WorksheetLine:                 //FIX - Support new AX2012 transaction table types

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(tablename2id(treeNode.AOTname()));         recordCount = sdt.recordCount();            if(!sdt.isTmp() && (!skipEmptyTables || (recordCount != 0))  )         {             TableAndCound = treeNode.AOTname()+ ' ('+ int2str(sdt.recordCount())+')';             setPrefix(TableAndCou

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) Root C

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 environm

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.  Finally this ALB file is placed back in the ALD file and the ALB file will be deleted. (HINT: make the ALD file read only and you will see it your self J ) When your AOS has creased the changes are not

Troubleshooting AXapta

Try again You probably already did, but make sure you can reproduce the problem. If it only occurred once, it’s not a problem. Check your code again Check your code carefully for errors, and maybe ask a colleague’s opinion. Compile Your project might contain compile errors, so compile it to be sure. Close the debugger Sometimes, when the debugger is active, AX will keep executing ‘old’ code. Close the debugger to make sure the latest code is executing. Compile forward When you have modified a class that is inherited by other classes, you might want to compile forward this class. Synchronize data dictionary You may have made changes to application objects that haven’t been synchronized with the database. Open the AOT, right click on the Data Dictionary node and choose Synchronize. Restart AX client Simple as that, close the AX client and start it again. Reset usage data Go to options screen (AX button > Extra > Options) and click the Usage Data button. Click reset to remo

AX EP site Checklist

I see a lot of people looking everywhere when the don’t get AX working in SharePoint. I have made a small list where to look. I hope this list makes working easier: ·          Check if the user has a relation in AX to that site.  (also check if the user is available on the SharePoint site) ·          Check if the user has the correct user groups. ·          Is the website only registered in 1 company? ·          Is the AOS running (this also result in white pages) ·          Is the proxy user defined in AX. ·          Is the proxy user available in the online user screen and the webuser not. In that case Sharepoint is ok. It can be that user autorisation is wrong (relations) or your webpart is corrupt. ·          IIS, is the application pool of the website equal to the proxy user.  ( The website http was not created correctly exception: no .net business connector sesion could be found) ·          Has the proxy user the right groups (IIS_WPG, WWS_WPG, PowerUser) ·          Do I see err

Configure Layer in Dynamics Axapta

A lot of times small mistakes are made with installing layers. The most common example is that code has been adapted in the USR layer of the live/production environment (import of an Xpo). With the next delivery this changed code of the Xpo also exists in the VAR layer. When we don’t remove the Xpo from the USR layer, tables and fields can exist twice in the data dictionary of Dynamics AX. As you know a field in a table has to be unique. When this is not the case Dynamics AX while provide synchronize errors. When the table is a system table of Dynamics AX, The AOS will even not start.   Copy the delivered Xpo or layer and label files to your delivery archive directory. (Note use   the delivery date in the folder name) Create in the archive directory a directory backup.     Stop all batch servers.   (task for 2009) Stop all AOS. Remove all cache files (del/s *.aoc). Create a database backup and copy this to the archive backup directory.(point 2) Copy the axVar.aod, axCus.aod and

The request failed with HTTP status 405: Method Not Allowed.

The request failed with HTTP status 405: Method Not Allowed. Recently on the Axapta-Knowledge-Village discussion board, the following workflow issue was raised, the user had an error when trying to validate his workflow url with the following message being displayed: “The request failed with HTTP status 405: Method Not Allowed.” He was running on the following System configuration: 1. Windows 2008 R2 64 bit. 2. SQL Server 2008 3. IIS 7 To resolve this error. I believe the simple solution suggested is to set your IIS application Pool’s 32bit property to true As a test to ensure that IIS is able to server a page, we were able to manually browse and view the AXWorkItem.asmx file ( http://myworkflowserver/MicrosoftDynamicsAXWorkflow50/AxWorkItem.asmx ). We verified that the AOS Service account had NTFS file security access to the Workflow web files and folders (These were installed under "C:\Program Files\Microsoft Dynamics AX\50\Workflow") We verified that the Mi