Dynamic list of methods to execute (in D365FO)

Imagine that you’re running a set of payment matching rules or you’re trying to find discounts based on various criteria. You’ll try one way to find the data, if it doesn’t bring anything, you try another one, and so on. A typical implementation looks like this: found = trySomething();   if (!found) { found = …

Continue reading ‘Dynamic list of methods to execute (in D365FO)’ »

Unit testing in AX – Dependencies

In my previous post on unit testing, I explained how to handle a few simple situations, nevertheless things often get more complicated. One such complication occurs if the class that you want to test uses other objects. It may be a problem for several reasons – it’s code that we don’t want to test in …

Continue reading ‘Unit testing in AX – Dependencies’ »

Decorator pattern and postings to general ledger

In this article, I want to use a real (albeit simplified) example to show an application of the Decorator pattern in Dynamics AX and the related refactoring. The requirement was something like this: “During the posting of an Expense Report (Expense Management module), find the maximum allowed amount, lower the transaction amount to this limit …

Continue reading ‘Decorator pattern and postings to general ledger’ »