Workflow Error Sending Email: “Execution Of User Code In The dotNET Framework Is Disabled”

Microsoft Dynamics GPThis 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:

Execution Of User Code In The dotNET Framework Is Disabled

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.

What should we write about next?

If there is a topic which fits the typical ones of this site, which you would like to see me write about, please use the form, below, to submit your idea.

Your Name

Your Email

Suggested Topic

Suggestion Details

Looking for support or consultancy with Microsoft Dynamics GP?

I no longer work with Microsoft Dynamics GP, but the last company I worked for was ISC Software in the UK; if you’re looking for support or consultancy services with Microsoft Dynamics GP you can contact them here.

1 thought on “Workflow Error Sending Email: “Execution Of User Code In The dotNET Framework Is Disabled”

Leave a Reply

Your email address will not be published. Required fields are marked *