‘is’ and ‘as’ operators with .NET types

I recently ran into an unfortunate limitation of .NET Interop from X++ (in D365FO). I wanted to check if an X++ object is of a given type, nevertheless the type used for the variable declaration was a .NET interface. Here is an example: using Microsoft.Dynamics.ApplicationSuite.FinancialManagement.Currency.Framework;   void demo(IExchangeRateProvider _provider) { if (_provider is ExchangeRateProviderCBOE) {} …

Continue reading ‘‘is’ and ‘as’ operators with .NET types’ »

Exception handling in PU31

In 2018, I wrote the blog post Throwing managed exceptions from X++ in D365FO, where I pondered upon how throwing proper exceptions objects in X++ would be beneficial. This is still true. I also showed a proof of concept how it can be done despite the fact that X++ doesn’t directly support it. But this …

Continue reading ‘Exception handling in PU31’ »

Compare records in code

When saving a record, I had to check which fields had changed and react in a special way if only certain fields (and not any other) changed their value. I could iterate all fields and compare their values in two table buffers (the original and the updated one), but I thought that D365FO might already …

Continue reading ‘Compare records in code’ »

Thoughts on element prefix vs. suffix

When I read Evaldas Landauskas’s blog post Development guidelines: Prefix Vs. Suffix, I thought I would write a comment below the post and share a few ideas, but then I decided that it’d be better to write my own blog post. Here I have a much better control over formatting and the content will be …

Continue reading ‘Thoughts on element prefix vs. suffix’ »

Security API

The product that used to be called Microsoft Dynamics 365 for Finance and Operations (I truly don’t know how I should call it these days) allows defining security elements both by developers (delivered together with code) and by power users though GUI (stored in database). You may have a need to work with security objects …

Continue reading ‘Security API’ »