HcmWorkerV2

I was asked to investigate why some changes disappeared from Employess form in F&O. If I open Human resources > Workers > Employees and right-click the form, it shows that its name is HcmWorker. That’s expected. But it’s a lie. There is a feature called Streamlined employee entry (HcmWorkerV2Feature class) and if it’s enabled, another form …

Continue reading ‘HcmWorkerV2’ »

Method as a parameter (in D365FO)

We usually have methods where the logic is written in code and it just receives some data in parameters. But sometimes it’s benefitial to allow the caller code to define a piece of logic by itself. For example, I can write code to filter a collection and let consumers decide what condition should be used …

Continue reading ‘Method as a parameter (in D365FO)’ »

The power of well-designed code

My previous blog post reminded me a refactoring that I did on one of my previous projects (in AX 2012). I needed to adjust a piece of logic and found that it’s implemented as a method with more than two thousand lines. Of course, nobody could understand what’s going on there. Such code in unmaintainable. …

Continue reading ‘The power of well-designed code’ »

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)’ »