Category: Programming

  • Dynamics ax take screenshots from FormControls

    Hi all, Here is a little code snippet for you to take screen shots within a Dynamics Ax client. This snippets uses the size of your control and the position on your screen to create the screenshot 🙂

  • Dynamics Ax printing from the AOS

    Hello, This post will be all about printing from printers that are connected on the AOS instead of the client. First up is installing a printer on the server thats hosts the AOS services. Next is configuring the client and server as shown in the next screenshots: In the printer setup you should now be…

  • Dynamics ax unknown software exception

    Hi, Ever had this error “The exception unknown software exception (0xc0000417) occurred in the application at 0x00a13c18”. Solving it is easy, just erase the .AUC files in the folder: C:\Documents and Settings\Current user\Local Settings\Application Data Or for Windows 7 / Windows server 2008 users: C:\Users\Current user\AppData\Local

  • Dynamics Ax SQL Trace

    Hi there, here is a simple job to enable SQL tracing for all your users, this quite handy for optimizing queries. (The macro’s for modifying other fields on the UserInfo table can be found on the ClassDeclaration of the SysUserSetup form.) Make sure that client tracing is enabled in the server configuration. (Only use this…

  • Dynamics Ax RunBaseBatch multithreading

    Hi, Next post will be a little tutorial on how the RunBaseBatch framework can work multithreaded. For example in the SalesFormLetter class on the method run, the following code will be found before the query iteration: The SalesFormLetterEndMultiThread that is being created will be called when all threads connected to that bacth are processed, this…

  • Dynamics Ax creating a batch job from code

    Hi, Here is a simple code snippet to create Batch jobs from code. This convenient when starting a heavy load job from a user interface and still keep the client responsive.

  • Dynamics Ax Creating sales orders with the SalesAutoCreate class

    Many projects use an interface to import their sales orders, because of this a SalesAutoCreate class was created. This class is easily extendable and customizable.The first thing to do is designing a buffer table, like this one for example: After this we can start extending a new class from the SalesAutoCreate class and modifying the…

  • Dynamics Ax Cleaning up the AIF document log

    While doing a small AIF project I wrote a small batch class to cleanup the AIF document log because the button on the AifDocumentHistory form can take up a huge amount of time. The first thing I did to write this class is checking out the standard Ax code in the following method ClassesAifMessageManagerclearAllProcessedAndError. This…

  • Dynamics Ax 2009 using the DateTimeUtil

    Since i’m getting a lot of google hits on my Dynamics Ax – workdays to days post, i’ve decided to blog some more about it. The DateTimeUtil class is actually a wrapper of the .NET DateTime class. A first thing to remember when using UtcDateTime EDT’s is that it is stored like the name says…

  • Dynamics Ax modifying CreatedDateTime

    For testing purposes with the MRP we needed to modify the createdDateTime fields in Dynamics Ax 2009. Since these are system fields we needed a workaround. if(isRunningOnServer() && CurUserId() == “Admin”) { new OverwriteSystemfieldsPermission().assert(); salesLine.overwriteSystemfields(true); // “YYYY/MM/DD HH:MM:SS” salesLine.(fieldnum(SalesTable,CreatedDateTime)) = str2datetime( “2010/04/03 11:00:00” ,321 ); salesLine.doInsert(); salesLine.overwriteSystemfields(false); CodeAccessPermission::revertAssert(); } Remarks: Since this code is pretty…