Tag Archives: X++

Language Specific Number Formatting

I recently encountered a situation in AX where I needed to convert a number into a string that was specific to the current user’s language setting. AX provides a method called num2str for converting a real number into a formatted … Continue reading

Share/Bookmark
Posted in AX 2012 | Tagged , , , , , , , , , | Comments Off

Automatic Class Pack/Unpack Part 2

In a previous post I demonstrated a way to pack & unpack a class in a manner that would always be version independent without the use of macros. In AX 2012 Microsoft added attribute support for classes and methods. When … Continue reading

Posted in AX 2012, Microsoft Dynamics AX | Tagged , , , , , | 2 Comments

Posting a Transfer Order using X++

While working with unit testing in AX, I came across the need to generate a transfer order and post it to generate the associated tables. I have used the FormLetter classes for posting Sales Orders & Purchase Orders in the … Continue reading

Posted in AX 2012, Microsoft Dynamics AX | Tagged , , , , | 6 Comments

Last Weekday of Month

This method will calculate the date of the last specified weekday in the month of the given date. static date lastWeekdayOfMonth(date _date, WeekDays _weekday){ int _endWeekDay, _diff; date _endDate = endmth(_date); ; _endWeekDay = dayofwk(_endDate); _diff = _endWeekDay – _weekday; … Continue reading

Posted in AX 2009, AX 2012, AX 4.0, Microsoft Dynamics AX | Tagged , , | Comments Off

Calculating a File Hash

Some time ago a colleague presented me the task of computing a SHA256 hash for an output file. This hash would be stored in a table in a hexadecimal string format, along with the file info, to ensure that the … Continue reading

Posted in AX 4.0, Microsoft Dynamics AX | Tagged , , , , , | Comments Off

Exporting Project Definitions

I concocted the following bit of code to automate the task of exporting project definitions to XPO files. It is a simple bit of code that allows the user to dump the project definition files to a specified folder.

Posted in AX 2009, AX 2012, AX 4.0, Microsoft Dynamics AX | Tagged , , , , | Comments Off

Parsing Date Strings

Dynamics AX provides functions for parsing date strings into a date object but they are limited at best. The following static method uses the .Net date parsing functionality to create a X++ date object from any valid date string without … Continue reading

Posted in AX 2009, AX 2012, AX 4.0, Microsoft Dynamics AX | Tagged , , , | Comments Off

CLR Array to AX List

If you use any amount of CLRInterop programming in Dynamics AX you have probably at some point or another needed to use X++ code to interact with an array object passed back from a bit of CLR code. I created … Continue reading

Posted in AX 2009, AX 2012, AX 4.0, Microsoft Dynamics AX | Tagged , , , , | 1 Comment

Automatic Class Pack/Unpack

A common task associated with creating objects in Dynamics AX is giving them the ability to be packed into a container for storage as a SysLastValue entry. The common methodology used for this is to declare a version and a … Continue reading

Posted in AX 2009, AX 4.0, Microsoft Dynamics AX | Tagged , , , | 1 Comment