Dynamics Ax 2012 my ideal Azure VM setup

Introduction This is just a quick note on how I setup an Ax 2012 on an Azure machine to get the most bang for my buck. The example I’m using is a DEV machine where I keep the sample code for this blog. But you could apply the principles for every environment. Sizing & disks… Continue reading Dynamics Ax 2012 my ideal Azure VM setup

Dynamics Ax RunBase overriding dialog with a Form

Hi, Some time ago I’ve found out that you can implement a form into a RunBase dialog, this has the advantage that you can easily use a grid control, etc… or use modified field methods without using controlMethodOverload() method. You can do this by overriding the dialog method and adding the following code. DialogRunbase dialogRunbase… Continue reading Dynamics Ax RunBase overriding dialog with a Form

Dynamics Ax printing logo’s from batch

Hi, Edit Microsoft has released a fix for this problem contact support for this As all of you know the Image class in Dynamics Ax 4.0 and 2009 can only run on client. This poses a problem when you want to print for example invoices with your company logo on it. Having this found out… Continue reading Dynamics Ax printing logo’s from batch

Dynamics Ax Reports with Calibri font

Hi, A customer of mine asked me to change the font of some reports to Calibri. It all went well until we saved a report as PDF, there was way too much spacing between characters. After some days of investigating and contact with Microsoft I’ve found out that it worked on a Windows Server 2008… Continue reading Dynamics Ax Reports with Calibri font

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. public void run(FormControl _control) { str SaveToFileName; System.Drawing.Bitmap bitmap; System.Drawing.Graphics graphics; System.Windows.Forms.Screen primaryScreen; System.Drawing.Rectangle bounds;   int x, y, k, l; System.Int32 width; System.Int32 height;   #define.FileName(’DynamicsAx_Screenshot.png’) ;   try { // 5 for the My… Continue reading Dynamics ax take screenshots from FormControls

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… Continue reading Dynamics Ax printing from the AOS

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.) boolean enable = true; UserInfo userInfo;   #LOCALMACRO.FLAG_SQLTrace ( 1 << 8 ) #ENDMACRO… Continue reading Dynamics Ax SQL Trace

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: if (this.canMultiThread()) { batchHeader = BatchHeader::construct(this.parmCurrentBatch().BatchJobId); salesFormLetterEndMultiThread = SalesFormLetterEndMultiThread::newFormLetter(this, salesParmUpdate.ParmId, salesParmUpdate.Proforma); batchHeader.addRuntimeTask(salesFormLetterEndMultiThread,this.parmCurrentBatch().RecId); } The SalesFormLetterEndMultiThread that is being created… Continue reading Dynamics Ax RunBaseBatch multithreading

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. TSTSalesOrderUpdate tSTSalesOrderUpdate;   BatchInfo batchInfo; BatchHeader batchHeader; ;   tSTSalesOrderUpdate = TSTSalesOrderUpdate::construct();   batchInfo = tSTSalesOrderUpdate.batchInfo(); batchInfo.parmCaption("Test from code"); batchInfo.parmGroupId("");   batchHeader = BatchHeader::construct();… Continue reading Dynamics Ax creating a batch job from code

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… Continue reading Dynamics Ax Creating sales orders with the SalesAutoCreate class

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… Continue reading Dynamics Ax Cleaning up the AIF document log

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… Continue reading Dynamics Ax 2009 using the DateTimeUtil

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: Make sure that… Continue reading Dynamics Ax modifying CreatedDateTime

Dynamics ax a key with the name %1 already exists

Today I had to fix a bug in some custom code in Dynamics Ax 2009, we had an error from the JournalTransList class that stated “A key with the name %1 already exists.” Cause: A custom field on the WMSJournalTrans table that was extending from LineNum Reason: The JournalTransList has methods to check if the primary… Continue reading Dynamics ax a key with the name %1 already exists