All posts by Erik Paulsson

Total discount is calculated automatically – Bug

Update: This issue was reported and has a hotfix that can be downloaded from Microsoft. Just create a new support issue on the partnersource and ask for the following:

Knowledge Base ID: 953178

Original post

The following checkbox ”Total discount is calculated automatically” makes sure that every order has its total discount calculated before it is posted.

Accounts Recievable/Setup/Parameters/Prices tab

AR - Parameters - Prices

This is done in the “clicked method” that executes when the posting button is clicked, this means that total discount is calculated on the sales order even before you get the dropdown where you can choose the different types of posting i.e. Invoice or Confirmation. But as it turns out, this does not seem work if you multiselect in the sales order form(Click thumbnail below to see the form).

Continue reading Total discount is calculated automatically – Bug

A quick look at lists and a bit of XML

This is just a quick look at the List object in Dynamics AX. Just played around with it to see what functionality was there and what wasn’t. As you can see I just created a simple list of integers and also one with records from InventTable, if you wan’t to know what types can be placed in the list, check out the baseEnum “Types” in the AOT.

As a bonus I also created a xml file of the list of integers.

Continue reading A quick look at lists and a bit of XML

Preparation for Dynamics AX certifications

I am currently studying to complete the Enterprise portal development certification exam. Today I found this link that describes the different parts of the exam. Anyone who have taken one of these exams before knows that you get your result for the entire exam but also for each of the exam parts. That is what this link gives you, an overview of the different parts and what subjects each part contains.

Microsoft learning manager.

You also get such information as what percentage each part is of the entire exam, which makes it easier to prioritize your studying in case of time restraints.

Send alerts/messages to online users

In Axapta 3.x there is a functionality that lets you send messages to online users. This functionality is lost in Dynamics AX 4.x which is a problem when you want an easy way to communicate with the online users. Maybe you want the users to know that that the AOS is going to be restarted at a specific time and as a result they should save their work and log out before this happens.

I’ve looked around the web and have found some examples on how to create these notifications, but none that worked all the way without a visit to the debugger. Tired of not having access to this functionality I decided to build it, and this is the result.

As the base I am using the alerts functionality in Dynamics AX 4.0.
Continue reading Send alerts/messages to online users

Open filtered forms with X++

When using forms in Dynamics AX we usually get access to them by clicking a button that uses a menu item, this along with the args that is sent we get a form that displays the requested information. But if you want to do this using code, how is this done?

You usually see this used in classes such as SalesFormLetter or PurchFormLetter that uses an existing form instead of a creating a temporary one. The user enters the information and the class uses the new information to perform the tasks at hand.
Continue reading Open filtered forms with X++

Jump between InterCompany order lines

This is a basic job that describes how you can jump from one order line to another in the intercompany order structure.

In this example I have created an intercompany order that also has a linked purchase order in the production company to a vendor. This is one way you can use to jump up between the linked order lines.
Continue reading Jump between InterCompany order lines


When programming Dynamics AX it is very easy to add days to a date. You can take todays date and just add an integer of five to get the date five days from now. But because this is easy to do it doesn’t mean that this always is the right way to go about this date business.

If you look closer at how the dates are calculated on the sales order lines or the purchase order lines in Dynamics AX you see that a class called WorkCalendarSched is used. This is because deliveries are dependant on when the company using Dynamics AX actually can send the order. Not all companies work on weekends.

This is when WorkCalendarSched comes in handy, with this class and the class method “shedDate” you can make sure that the delivery is set to a day when the company actually is going to be able deliver.
Continue reading WorkCalendarSched


This is an easy way to use labels and infologs in a bit more dynamic manner. It also makes it easier to do type conversion of for example dates to strings when printing to infologs.

static void FO_StrFmt(Args _args)
    CustTable   cust    = CustTable::find("4000");
    SalesTable  sales   = SalesTable::find("00697_036");
    info(strFmt("Hello %1!", cust.Name));
    info(strFmt("Hello %1, you live in %2!", 
                cust.Name, cust.City));
    info(strFmt("%1", sales.DeliveryDate));


Hello Light and Design!
Hello Light and Design, you live in Los Angeles!

Notice that the date is presented in the format that is set up on the clients computer. In this case the Swedish format. The same format that you see in the Sales Table form.