Keep up to date with the latest information about Microsfot Dynamics GP through articles from the Perfect Image and azurecurve blog.
Workflow Error Sending Email: “Execution Of User Code In The dotNET Framework Is Disabled”
March 31st, 2017 by Ian Grieve
This has come up twice fairly recently. In the first case it was following an upgrade to Microsoft Dynamics GP 2016 and workflow was being introduced for the first time, and in the second it was when a client had created a new test system:
Microsoft Dynamics GP
[Microsoft][SQL Server Native Client 11.0][SQL Server]Execution of user code in the .NET Framework is disabled. Enable "clr enabled" configuration option.
“clr” is the SQL Server common language runtime which provides the execution environment for all .NET Framework code in SQL Server. .NET code execution of code in SQL Server stored procedures is how Workflow sends the emails. According to the Microsoft Developer Network, clr is off by default which I find somewhat surprising as I have implemented Microsoft Dynamics GP Workflow 2.0 a number of times now without encountering this problem.
You can check the status of clr by running the following command:
SELECT * FROM sys.configurations WHERE name = 'clr enabled' GO
To enable clr, execute the following command:
sp_configure 'show advanced options', 1; GO RECONFIGURE; GO sp_configure 'clr enabled', 1; GO RECONFIGURE; GO
Once clr has been enabled, Workflow 2.0 will be able to send emails without further problem.