Create Instance of DotNet variables – the hard way!

Have you ever seen this error:

Assignment is not allowed for this variable? But it’s just a DotNet class that I’m trying to make an instance of. (The class in my example is DocumentFormat.OpenXml.Spreadsheet.Text that is used for adding strings to Excel sheets).

But this is Applied Hacking, so we can use reflection to get around this. Here is “DotNetConstructor”, simplified to a version where the constructor takes just one parameter

The idea is simple, get the ConstructorInfo and Invoke it. To do that, you need a DotNet Array first with the Types of parameters and then antoher array with the parameter values. This function can easily be extended to handle multiple parameters.

So instead of using:

Text := Text.Text('Value');

We can just do:


Enjoy πŸ™‚

Keeping track of the Microsoft Dynamics 365 Names and Products

I’m having a hard time keeping up with what names the different Dynamics 365 offerings have, and what products they come from. Maybe others are having the same issue, so here is my table:

Dynamics 365 NameOrigin Product
Dynamics 365 SalesDynamics CRM
Dynamics 365 Customer ServiceDynamics CRM
Dynamics 365 OperationsDynamics AX (7)
Dynamics 365 FinancialsDynamics NAV
Dynamics 365 Field ServiceDynamics CRM
Dynamics 365 Project Service AutomationDynamics CRM
Dynamics 365 MarketingAdobe Marketing Cloud
Dynamics 365 Customer InsightWill be part of "sales"

As you can see, there is still a couple I’m not sure of. Regarding pricing, you buy in bundles, so “Dynamics 365 Plan 1” includes:

  • Dynamics 365 for Sales
  • Dynamics 365 for Customer Service
  • Dynamics 365 for Field Service
  • Dynamics 365 for Project Service Automation

Dynamics 365 Plan 2” includes everything in Plan 1 plus:

  • Dynamics 365 Operations (AX)

Here is an odd thing, “Plan 1” costs $112 pr. user/month and “Plan 2” costs $210 pr. user/month, “Operations” alone cost $190, ie. the double of the $95 added to plan 1?

Business Edition” covers Dynamics 365 Financials (aka. NAV) but does not give you the opportunity to combine with the other 365 offerings currently. (Info taken from

Currently no pricing info on the rest, just a “Contact Us” form.

Please reach out to me at @eHougaard if I’m missing something orΒ  misunderstanding something πŸ™‚


Let’s get some more return value types

One of the things that I’m always missing in Microsoft Dynamics NAV is support for more return value types:

I would like to be able to return all variables types, to support a more functional programming flow. Currently, I’m missing:

  • Record
  • DotNet
  • Variants
  • RecordRef
  • FieldRef
  • Streams

Hey Microsoft, how about adding some of these πŸ™‚

(I know that I can just use VAR parameters, but they generate a cluttered program flow, one example is that it’s not possible to pass the output of a function call as a parameter to another if the return value is a VAR parameter).