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

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