Connection to external database

You sometimes need to connect from Dynamics AX to another database and read or write data there. The usual approach uses OdbcConnection class, as described on MSDN in How to: Connect to an External Database from X++ Code [AX 2012]. Although it definitely is a possible solution (I used it already in AX 3.0), it …

Continue reading ‘Connection to external database’ »

AX management shell – multiple models

Even if you’re not familiar with PowerShell, you probably don’t have much trouble with using AX management cmdlets. You just call the right command, set some parameters and it’s done. # Just for example Export-AXModel -Model "MyModel" -File "c:\my.axmodel" If you don’t know the parameters, you’ll simply use Get-Help or some of its aliases, such …

Continue reading ‘AX management shell – multiple models’ »

Refactoring of financial reasons

If you’re not sure what “refactoring” means, note that it is a change of the structure of code without changing how the application behaves. It might sound useless, but it’s actually very important. You must realize that the quality of code doesn’t depend only on its runtime behavior – whether you can easily maintain and …

Continue reading ‘Refactoring of financial reasons’ »

Talk in Prague – Dynamics Technical Conference: Direction of AX

I apologize, but if you’re unfortunately enough not to speak Czech and not to live near to Prague, you probably can stop reading. Hopefully you’ll find something more useful here next time. Others please note that I’m giving a talk about Dynamics AX in Prague on Tuesday, 24 February 2015. On the beginning on February, …

Continue reading ‘Talk in Prague – Dynamics Technical Conference: Direction of AX’ »

Custom date and time format

I was extending a customization of Dynamics AX when I ran into the following piece of code. It formats the current date and time to something like 20150525_0042. str dateValue, dateFormat;   dateValue = date2str( systemDateGet(), 321, DateDay::Digits2, DateSeparator::None, DateMonth::Digits2, DateSeparator::None, DateYear::Digits4, DateFlags::FormatAll);   dateFormat = strFmt( "%1%2%3", dateValue, ‘_’, subStr( strRem(time2Str(timeNow(), TimeSeparator::Space, TimeFormat::Auto), ‘ …

Continue reading ‘Custom date and time format’ »